Ensure that the various variables are passed through and reset
correctly. If we end up doing this in a bunch of places we may add some
helpers to simplify this.
Without an empty line before the horizontal rule (---), "Created with `brew
bump-formula-pr`." is treated as a setext header.
The newline before the hr is not part of the heredoc because putting it in
would trip up Rubocop.
If `--no-browse` is passed, don't pass the `--browse` argument to `hub`
which opens the pull request URL in a browser. Instead, output it to the
command line.
Due to limitations of `hub fork` in hub 2.2, scripts had to repeat the
command at least two times; the 2nd time was to read the fork name from
the "fatal: remote MYNAME already exists" message output from git.
In upcoming hub 2.3, the `hub fork` command is improved to always output
the remote name, regardless of whether one already existed or not. With
this approach, only one `hub fork` call will ever be necessary when hub
is up to date.
We first search for gtar in PATH, then
check if Homebrew's gtar is available,
then finally search for tar in PATH.
Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
Creating a fork and pushing to it doesn't work when the repository in
question is a shallow clone. By default, Homebrew clones all taps in
shallow mode unless `--full` was passed or $HOMEBREW_DEVELOPER was set.
Reduce the chance of false flagging by making sure that the existing pr
surfaced by GitHub.issues_for_formula actually contains the exact formula name
in its title.
Previously, old mirrors are only removed if the requested spec is
stable, and if the mirror lines only have two leading spaces. This leads
to stale mirror line(s) when the formula a stable block like
stable do
url "http://example.com/v1.0.tar.gz"
mirror "http://example.net/v1.0.tar.gz"
end
where the mirror line is lead by four spaces.
In this commit, we discard the /(^ mirror .*\n)?/ pattern, and instead
create a pattern with the exact url and flexible leading spaces for each
mirror of the requested spec.
When a --version is specified, use this specified version in the name of
the downloaded file rather than the default that is parsed from the URL.
For instance,
brew bump-formula-pr --devel \
--url=http://www.zsh.org/pub/development/zsh-5.2-test-2.tar.gz \
--version=5.2-test-2 zsh
should download to $HOMEBREW_CACHE/zsh-5.2-test-2.tar.gz (correct
behavior after this commit) rather than
$HOMEBREW_CACHE/zsh-2.tar.gz (wrong behavior before this commit).