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

140 Коммитов

Автор SHA1 Сообщение Дата
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ć 90523e4da6 Tweak descriptions of several commands 2019-01-21 21:54:34 +01:00
Mislav Marohnić f5df7cab9f Passing values for long-form flags is now available without `=` 2019-01-21 21:35:15 +01:00
Mislav Marohnić ebcc3897d5 Clear up `hub pull-request --issue` documentation
Passing a URL to `--issue` has never worked. It has to be a number.

Passing a URL like `hub pull-request <ISSUE-URL>` has worked but hasn't
been documented. I do not wish to add it to documentation now, as it may
be dropped in the future.
2019-01-18 01:50:28 +01:00
Mislav Marohnić d0f126f95e Switch pull-request to ArgsParser 2019-01-18 01:50:28 +01:00
Mislav Marohnić 02989309ed Docs formatting issues 2018-12-28 17:54:15 +01:00
Mislav Marohnić 2a748a048d Un-deprecate converting issues to pull requests
5 years ago, in anticipation of an API change, I have made the call to
deprecate issue-to-PR conversion in hub. 4f70dd126f

Issue-to-PR conversion was wonky at those times, poorly understood, and
was generating a lot of support requests to hub's issue tracker that I
didn't want to deal with. In most cases, people tried to convert issues
that they have no rights over and they would get a cryptic validation
error in the API response.

Since then, there was a consistent plea from the hub community to keep
this feature as some teams seem to rely on this for their workflows. I
have consulted with other GitHub employees about the stableness of this
feature, and anecdotal evidence suggests that lately there haven't been
as many problems around this as there have been in the past. Also, the
GitHub API v3 will not be getting breaking changes, so it sounds like
this feature is here to stay.

Fixes #1927
Ref. #532, #410, #1806, #1770, #1628
2018-12-28 07:52:45 +01:00
Mislav Marohnić 2b73d4faed Document how we scan git remotes and branch tracking information 2018-12-28 07:21:03 +01:00
Mislav Marohnić 858e97c596 Encapsulate `localRepo.RemoteForProject(project)` function 2018-12-28 03:54:14 +01:00
Mislav Marohnić 258b700914 Indicate that long-form CLI flags are used like `--message=VALUE`
The previous format of documentation made it look like `--message VALUE`
(no equal sign) would be supported, which might be misleading.
2018-12-18 17:49:09 +01:00
Mislav Marohnić f98928699d Add support for passing multiple `--message` options
This is for compatibility with git-commit(1)
2018-11-28 03:05:15 +01:00
Mislav Marohnić 7467e49c90 Clarify documentation about what constitutes a title in `--message`
It's not only the first line of text; it's the entire first "block" (or
paragraph) of text with newlines turned into spaces. This is for
compatibility with git-commit(1).
2018-11-28 02:38:12 +01:00
Robbie Averill de2dcbddb5
Update --labels documentation to show it will be created if not exists 2018-10-19 16:32:18 +02:00
Mislav Marohnić de684cb613 Tweak `pull-request -F` example in the documentation
[ci skip]
2018-09-06 12:57:45 +02:00
Mislav Marohnić a053739001 Add examples to `pull-request` documentation
Fixes #1866 [ci skip]
2018-09-06 12:55:39 +02:00
Mislav Marohnić adcfd980d3 Avoid re-requesting reviewers in case of CODEOWNERS
Requesting a review via `hub pull-request -r foo` would print a
misleading error message that `foo` couldn't be requested for review in
case `foo` was already requested per CODEOWNERS.

Fixes #1840
2018-08-23 14:39:11 +02:00
Mislav Marohnić a9bb733386 `pull-request --no-edit`: test case for no commits detected 2018-06-06 15:53:43 +02:00
Harald Nordgren 2628ba3471 Create '--no-edit' option for hub pull-request 2018-05-31 12:37:08 +02:00
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