Граф коммитов

895 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Pry 2da382e555
Use consistent quotes around branch names
Fixes #2233.
2019-08-20 10:44:54 -04:00
Mislav Marohnić 1787dd9de1
Merge pull request #2225 from whuang8/pr-list-comments-removal
Remove NC/Nc from pr list formatting
2019-08-20 09:42:59 +02:00
whuang8 6a7b8c7a60 Remove added whitespace 2019-08-19 20:40:44 -05:00
whuang8 858d487006 Remove unnecessary function 2019-08-19 20:39:29 -05:00
Mislav Marohnić 3edbd86fab
Merge pull request #2218 from tpope/empty-alias-error
Fix error message on hub --paginate
2019-08-19 15:41:56 +02:00
Mislav Marohnić 55f886ccb2
Merge pull request #2206 from muesli/assignment-fixes
Fixed ineffectual assignments in tests
2019-08-19 15:27:51 +02:00
whuang8 8d74db79c3 Remove NC/Nc from pr list formatting 2019-08-13 23:06:59 -05:00
Tim Pope cf4772eed0 Fix error message on hub --paginate
Calling hub with one or more options but no subcommand resulted in the
following error message trying to expand an empty string as an alias:

	error: key does not contain variable name: alias.

This fixes the root cause: attempting to retrieve an invalid config key.
2019-08-03 18:25:56 -04:00
Christian Muehlhaeuser 2fdb738a9d
Fixed ineffectual assignments in tests
Don't assign values we don't end up checking.
2019-07-23 09:31:17 +02:00
Christian Muehlhaeuser f0c3ce9fb3
Simplify code
- Use bytes.Equal instead of bytes.Compare
- Use time.Since instead of manual timestamp subtracting
- Use sort.Strings instead of sort.StringSlice
- No need to specify the len of the slice
2019-07-23 09:28:32 +02:00
Mislav Marohnić 6a13adf2cc [help] Enable `man` appearing in path that has spaces
Avoids shell-splitting manProgram unless the value was read from the
$PAGER environment variable.
2019-06-28 21:41:26 +02:00
Mislav Marohnić ce213d7c8f [env] Enable quoted values with spaces in $BROWSER
Makes possible:

    BROWSER='"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --extra --flag' hub browse

Fixes #2178
2019-06-28 21:41:17 +02:00
Mislav Marohnić de6f95cc07 Merge pull request #1952 from OliverJAsh/patch-1
Docs: mention that comma-separated lists must not have spaces
2019-06-25 18:07:42 +02:00
Mislav Marohnić 9cb62f9ffc [pull-request] Avoid crash when branch is pushed to a non-GitHub remote 2019-06-25 17:35:31 +02:00
Mislav Marohnić b6d9837aa7 [api] Implement GraphQL pagination
The GraphQL query has to accept the optional `endCursor` string variable
and output `pageInfo`:

    pageInfo {
      hasNextPage
      endCursor
    }
2019-06-15 15:54:07 +02:00
Mislav Marohnić 424acfa86f [api] Implement REST pagination 2019-06-15 15:16:16 +02:00
Mislav Marohnić 583488c713 [pull-request] Abort if the current branch doesn't seem published
This is the heuristics we apply to determine if a branch was pushed:

1. The branch has remote tracking information (`branch.<branch>.remote`
   and `branch.<branch>.merge` config) that does NOT point to the
   base branch for this pull request; or

2. There exists a `refs/remotes/*/<branch>` ref in any git remote.

Otherwise, we consider the branch NOT pushed and we abort before
processing the pull-request command further.
2019-06-15 03:10:16 +02:00
Mislav Marohnić 66fce6e4d3 Merge remote-tracking branch 'origin/master' into issue-1930 2019-06-15 01:31:32 +02:00
Mislav Marohnić 45f7d02a7d
Merge pull request #2141 from ashemesh/master
[pr] add ability to open Pull Request in the browser

Closes #1586
2019-06-15 00:41:37 +02:00
Mislav Marohnić 8b49f3c0a7
Merge pull request #2166 from daniel-vera-g/fix-#2155
Add a milestone name instead of an id, when creating
2019-06-15 00:31:59 +02:00
Mislav Marohnić fcdcfffc4a [pr show] Support upstream configuration with no tracking branch
If `hub pr checkout <NUMBER>` was used, the tracking configuration for
the created branch might look like this for forks:

    branch.<branch>.remote https://github.com/<owner>/<repo>.git
    branch.<branch>.merge refs/heads/<branch>

Since `RemoteBranchAndProject()` doesn't handle this case, we can't use
it. I want to avoid expanding its functionality right now since it's
being used in several places and I don't want to risk causing
regressions in other commands. Instead, `pr show` now performs its own
upstream branch lookup.
2019-06-15 00:27:43 +02:00
Mislav Marohnić a7426780ae [pr show] Add ability to open a pull request based on number 2019-06-14 16:32:58 +02:00
Mislav Marohnić 7a62066524 [pr show] Cover scenario where no matching pull request was found 2019-06-14 16:08:13 +02:00
Mislav Marohnić 0a755b3d98 [pr show] Fix implementation for triangular workflow scenario 2019-06-14 16:05:45 +02:00
Mislav Marohnić 8047583ad4 [pull-request] Add `--no-maintainer-edits` flag 2019-06-14 15:00:41 +02:00
Mislav Marohnić e5cc8207cd [issue] Support passing either milestone name or number 2019-06-14 02:46:29 +02:00
danielVg 25f56c7de9
Add a milestone name instead of an id 2019-06-12 18:54:00 +02:00
Florian Thomas ad28ff3146 check head branch exists before creating PR
Previously hub checked that there were
[no unpushed commits](b3b3ebb8e5/commands/pull_request.go (L219-L223))
but this check doesn't work when there is not even a remote branch.

This fixes #1930.
2019-06-09 16:46:03 +01:00
Mislav Marohnić 2c83c152fa [create] Fix newline in error message
Fixes #2162
2019-06-06 23:31:03 +02:00
Daniel Compton 629437c8c9 Move commitLogs declaration inside multiple commits block
This makes it clearer that commits are only added as a commented section
in the case when there are multiple commits on a branch.
2019-06-05 04:54:21 +12:00
Mislav Marohnić d76e3e8ebf pull-request: support detached HEAD if `--head` was passed
Fixes #2146
2019-05-29 22:34:41 +02:00
Assaf Shemesh 9495211932 [pr] add ability to open Pull Request in the browser 2019-05-25 21:55:42 +02:00
Mislav Marohnić 039afea3c6 Only process stdout when shelling out to git
For stderr, either attach it to parent stderr or silence it completely.
This enables GIT_TRACE.
2019-05-08 20:51:49 +02:00
Mislav Marohnić d8973922ac Propagate global git arguments to Before/After chains
This fixes `hub -C mydir merge <URL>` and other commands that might be
invoked with git global arguments by ensuring that those global
arguments are also fowarded to any accompanying `git` commands within
`Before()` and `After()` chains.
2019-04-14 15:08:21 +02:00
Mislav Marohnić accfda9aa4 [remote] Avoid crash in argument parsing
Fixes #2102
2019-04-08 12:11:54 +02:00
Mislav Marohnić d2d203bcad [pull-request] Fix non-draft pull requests
This works around a GitHub API issue where it blocks PRs based on their
draft status even if they were `draft: false`.

Fixes #2099
2019-03-29 12:33:09 +01:00
Mislav Marohnić b99071f118 [pull-request] Tweak & test opening a PR as a draft 2019-03-29 02:02:40 +01:00
Matthieu Antoine b207e80358 Implement opening draft pull requests
Implement draft by adding a -d / --draft argument. Add setting header on
the API client for the moment as the feature is still in preview on the API
2019-03-29 01:18:03 +01:00
Mislav Marohnić e4fe4bae37
Merge pull request #2096 from github/no-command
Fix compatibility with git when run with no arguments
2019-03-29 01:12:18 +01:00
Mislav Marohnić d78097d2b1 [issue] Fix `--format %L` output in no-color mode 2019-03-29 00:28:44 +01:00
Mislav Marohnić 4412eddff1 Fix compatibility with git when run with no arguments
Fixes this error:

    $ hub --git-dir=.git
    git: '' is not a git command. See 'git --help'.

Instead, help text is shown just like with normal git.
2019-03-28 23:55:24 +01:00
Mislav Marohnić dadc26d2e4 Allow repository names that start with a dash character
These are allowed on GitHub.
2019-03-18 12:49:42 +01:00
Mislav Marohnić 08f2844e47 [help] List `api` among custom hub commands
Fixes #2066
2019-03-11 20:37:23 +01:00
Mislav Marohnić 5d42f7dbad [checkout] Make it work independently of remote refspec
This fixes:

    fatal: Cannot setup tracking information; starting point 'BRANCH' is not a branch.

if the remote refspec is set up to only fetch specific branches and NOT
like the default `+refs/heads/*:refs/remotes/origin/*`.

I don't understand why would git, after fetching into
`refs/remotes/origin/BRANCH`, complain that `origin/BRANCH` is not a
branch, but there we have it. Setting up upstream tracking manually
works around this problem.
2019-02-24 09:58:51 +01:00
Mislav Marohnić ad6e36233d [release] Clarify that `delete` doesn't remove the git tag
Ref. #2043
2019-02-20 19:05:19 +01:00
Mislav Marohnić d21937391a [pr] New format fields `%pS` and `%pC` for PR state and color
- `%pS`: "open", "draft", "merged", or "closed"
- `%pC`: green, gray, purple, or red
2019-02-18 15:26:06 +01:00
Mislav Marohnić 3625691293 [cli] Have commands with rich output respect the `--color` flag
- default: `--color=auto`
- `--color` is equivalent to `--color=always`
- `--color=never` disables color for TTYs
2019-02-18 14:21:25 +01:00
Mislav Marohnić 57187d17ea Merge branch 'remote_names'
Fixes https://github.com/github/hub/issues/2025
2019-02-13 01:39:16 +01:00
Mislav Marohnić 2d0f786b38 [create] Support `--remote-name <REMOTE>` argument 2019-02-13 01:37:52 +01:00
Mislav Marohnić 3ab153abe6 [create] Simplify checking for invalid first argument 2019-02-13 01:29:08 +01:00