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.
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
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).
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
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>
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.
Previously, passing `--edit` in combination with `-m` would skip opening
the editor. For compatibility with `git commit`, `--edit` is now always
respected.
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.
`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
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.
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.
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.