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

121 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić 41316167c2 Reflect `--edit` option in documentation 2018-05-29 17:17:44 +02:00
Mislav Marohnić 87d54b1dc8 Avoid unnecessary trim space from issue/PR templates
Also, split the pull request template with two newlines in between for
compatibility with GitHub web interface.

Fixes #1714
2018-05-29 15:11:23 +02:00
Mislav Marohnić 3d50725c2b Add test for stripping `Signed-off-by` line 2018-05-29 12:23:39 +02:00
Ahmet Alp Balkan 2c9de69120
pull-request: Hide Signed-off-by
Fixes #1724.

This patch omits the "Signed-off-by:" line coming from pull requests created
out of single commit messages. This way the user does not need to manually
remove their email address from the PR description.

Not introducing a flag for this as it applies to only one case (single-commit
diff between heads, as well as no -m/-f/-i specified).

Meta: sending this PR with the patched build, my Signed-off-by line is removed
automatically from the PR message.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-05-28 11:04:16 -07:00
venyii c8d2cc0247
Add milestone to pr by name instead of number 2018-03-16 00:28:06 +01:00
Mislav Marohnić a4274c1615 Show commented-out help text whenever an editor is opened
This shows commented-out text such as "Creating an issue for github/hub"
not only when `-m` or `-F` weren't passed, but also when they were
passed and `--edit` was used.
2018-01-23 18:08:23 +01:00
Mislav Marohnić 2e47a2d732 Fix PR template on a branch with a single commit
The commit body comes first, then template text. This is for
compatibility with GitHub web interface.

Fixes #1657
2018-01-23 16:26:34 +01:00
Mislav Marohnić df2e473e97 Refactor message editing and always respect `--edit`
Previously, passing `--edit` in combination with `-m` would skip opening
the editor. For compatibility with `git commit`, `--edit` is now always
respected.
2018-01-23 16:15:56 +01:00
Mislav Marohnić 7b2311e0f7 Merge remote-tracking branch 'origin/master' into commentchar-auto 2018-01-23 12:03:30 +01:00
Jimmi Dyson ecd246c890
Add -p flag to pull-request command usage 2018-01-22 11:53:13 +00:00
Mislav Marohnić f8663339b0 Enable team reviewers in `pull-request` 2018-01-19 14:47:06 +01:00
Mislav Marohnić 04e43fa22f Use full text editor filename at call site for greppability 2017-07-31 17:33:41 +02:00
Mislav Marohnić 4837835d6d Refactor how commented sections are added to contents of text editor
Before, the code outside of `editor.go` was responsible for prefixing
lines of the commented section with the comment char. The code to do
this was scattered all over the codebase and was difficult to refactor
re: adding support for `commentchar=auto`.

Now, Editor has a `AddCommentedSection()` method that allows for
declarative adding of a commented section. Furthermore, the caller
doesn't have to query git to determine the comment char.
2017-07-31 17:33:41 +02:00
Mislav Marohnić 01c3099abe Fix crash in `WorkdirName` when within bare git repo
`git rev-parse --show-toplevel` returns an empty string with success
status when inside a bare git repo.

This avoids the go crash and also tweaks `hub issue` and `hub
pull-request` to work even if current working directory name couldn't be
obtained because it's only used for looking up issue/PR templates, which
isn't critical functionality.

Fixes https://github.com/github/hub/issues/1331
2017-06-26 20:22:11 +02:00
Tomas Varneckas 0fad51944f
Add support for review requests in pull-request command 2017-04-17 18:34:54 +03:00
Natalie Weizenbaum fb40cab7fd Add --set-upstream to git push commands.
This ensures that a branch pushed using "hub pull-request" has its
upstream branch set to the target of the push.
2016-12-07 13:47:46 -08:00
Mislav Marohnić 1a3a934714 Fix issue/PR template lookup when in a subdirectory
Always start template lookup from the toplevel directory of the repo.

Fixes #1242
2016-11-21 13:00:57 +01:00
Mislav Marohnić 4a147e8c46 Introduce HUB_RETRY_TIMEOUT 2016-10-22 12:32:52 +02:00
Mislav Marohnić 2437c48e65 Automatically retry creating a PR after 422 on `--push`
Since `--push` has just created a new branch, there could be a slight
delay before GitHub registers it, and there's a possibility that a 422
would be returned for the "head" field. If that happens, retry the POST
a couple of times until it either succeeds or times out.
2016-10-22 12:10:00 +02:00
Mislav Marohnić d68e6e4a78 Cleanup style 2016-10-22 12:09:48 +02:00
Natalie Weizenbaum f5544ec9e6 Code review changes. 2016-10-20 13:56:13 -07:00
Natalie Weizenbaum 05d203934c Add a --push flag to hub pull-request.
This removes an extra step from the process of publishing a pull
request. It also gives the user a chance to back out of the entire
process by saving an empty pull request message.
2016-10-03 13:40:20 -07:00
Mislav Marohnić f7c1105df3 Copy to clipboard for `create`, `issue`, `pull-request`, `release`
Also add `--browse` functionality to `create` and `release` for parity
with `issue` and `pull-request`.
2016-09-11 18:21:23 +02:00
Mislav Marohnić 58ad61db27 Use a shared helper function to print or browse URLs 2016-09-11 04:38:13 +02:00
Mislav Marohnić 0c4689c673 Fix printing content on Windows after successful run
The old `args.After("echo", ...)` approach won't cut it on Windows since
there is no `echo` executable. Thus, nothing was printed on Windows.

Instead, expand Args type with extra functionality that allows Go
callbacks after all commands in the chain have been run.

Also, the new `args.NoForward()` is now preferred to `os.Exit()` since
it's more descriptive and allows `defer` in the calling function.
2016-09-10 23:49:58 +02:00
Mislav Marohnić 3ab56f59b5 Fix assigning labels/assignees without the other
The GitHub API doesn't seem to like receiving `"assignees": null`.

Fixes #1240
2016-09-08 23:27:32 +02:00
Mislav Marohnić 860c910419 Unify `-F <filename> -e` functionality between commands 2016-08-21 12:40:16 +02:00
Mislav Marohnić b5e6387111 Merge remote-tracking branch 'origin/master' into edit-message 2016-08-21 11:33:39 +02:00
Mislav Marohnić 5d6090207f Tweak whitespace in issue/PR template handling 2016-08-21 11:22:57 +02:00
Mislav Marohnić d5cd91f672 Merge remote-tracking branch 'origin/master' into pull-request-templates 2016-08-21 09:14:21 +02:00
Mislav Marohnić d2792baf73 Switch `pull-request` assignees and labels flags to `listFlag`
This allows accumulating values across repeated arguments.
2016-08-15 14:08:44 +02:00
Mislav Marohnić efa3ce7cf1 Consolidate `github.PullRequest` structs 2016-08-14 19:54:31 +02:00
Mislav Marohnić af72087bc7 Add support for multiple assignees 2016-08-10 11:44:38 +02:00
Mislav Marohnić f46eb1f932 Fix setting assignee, milestone, labels on new PR 2016-08-10 11:16:05 +02:00
Mislav Marohnić 25a4dd061c Resolve owner name in PR `head` specification in case of redirects
When the repo that hosts the `head` for the PR is moved to another
owner, the `owner:branch` specification will be wrong and the GitHub API
will return HTTP 422.

This resolves the latest owner/name pair for head repo so that the value
is never stale when submitting new PR to be created.

Fixes #467
2016-08-09 22:07:33 +02:00
Mislav Marohnić 56fce4bc6b Migrate PR creation to simpleApi 2016-08-09 22:02:04 +02:00
ganmacs 9144e1df31 Add template tests 2016-05-30 12:49:53 -07:00
Nick LaMuro fae4730bad Implement GeneratePRTemplate in pull_request.go
Implements the GeneratePRTemplate in pull_request.go instead of the
custom logic that previously existed in the file.  Addresses:

* Title being defaulted as the first line of the template
* Commit messages not defaulting as the title only properly
2016-05-30 12:49:53 -07:00
ganmacs 085821f05e fix typo 2016-05-30 12:49:53 -07:00
ganmacs 2cf8451ad3 Support Pull Request tempalte 2016-05-30 12:49:53 -07:00
Carlos Martín Nieto 9413795ec7 Fix copy-pasta
The description for --head said it was the head branch instead of head branch.
2016-04-21 12:15:07 +02:00
Mislav Marohnić fc9fbd4c38 Cross-references galore! 2016-01-25 02:50:01 +11:00
Mislav Marohnić 0a45aa8ddc Reformat inline command help and expand usage options 2016-01-25 02:30:46 +11:00
Mislav Marohnić 1b862e3388 Switch from godep & rewriting import paths to GO15VENDOREXPERIMENT 2016-01-20 14:46:44 +11:00
Mislav Marohnić 648f25cf2f Fix assigning user to pull request without labels
Fixes #1057
2016-01-20 13:46:59 +11:00
Keenan Brock 5355655711 rename gh command to hub in docs 2016-01-19 13:31:47 -05:00
Mislav Marohnić ea2edfc101 Fix man page formatting after `pull-request` changes
[ci skip]
2015-09-26 19:15:43 +02:00
David Calavera 401c004564 Add missing completions and docs for pull-request flags.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-06 16:21:43 -07:00
David Calavera 2ab5c55589 Allow to set pull request milestone and labels.
Add the `-M/--milestone` and `-l/--labels` flags to `hub pull-request` to
set the milestone or tags when a pull request is created.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-05 14:29:51 -07:00
m_nakamura145 fd09d23bf2 Add -e option to pull request 2015-07-01 23:17:20 +09:00