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).
For `hub release show`, `MainProject()` was used to fetch the canonical
repo of the current project. However, the `create`, `edit`, and `delete`
operations used `CurrentProject()` most likely by mistake. This caused
the `hub release edit` operation, for example, to be potentially
performed against a fork rather than the canonical repo, depending on
the currenly checked out branch.
Fixes#1881
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.
To mirror all the other `hub release` commands, allow the user to delete
releases from the command line. The new subcommand takes only one
argument (the tag of the release being deleted).
Fixes#1326
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.
Don't try to default `target_commitish` to the currently checked out
branch. Instead, keep the value blank unless explicitly provided. It
will default to the main branch on the server.