Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump-formula-pr: forward compatibility with hub fork #3061

Merged
merged 1 commit into from Sep 8, 2017

Conversation

mislav
Copy link
Sponsor Contributor

@mislav mislav commented Aug 15, 2017

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?

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.

/cc @e-beach mislav/hub#1535

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.
@MikeMcQuaid
Copy link
Member

👍 when @ilovezfs has tested it and is happy. Nice work on the feature @mislav!

@ilovezfs
Copy link
Contributor

@mislav yes, I'd noticed this. Thanks for taking care of it. Unfortunately, this PR only works for hub stable and HEAD, but devel remains broken (and I'm not sure it's easily fixable since devel outputs nothing). Maybe it's time for a new hub release or at least a new devel release?

@mislav
Copy link
Sponsor Contributor Author

mislav commented Aug 28, 2017

@ilovezfs Thank you for testing this. Let me check what's up with current devel and get back to you. Yes, it's easy for me to cut a new devel release, but I'd rather that this script works with any version of hub (old or new).

@ilovezfs
Copy link
Contributor

Thanks @mislav!

@jasonkarns
Copy link
Contributor

FWIW, hub --HEAD is now breaks as well:

HOMEBREW_DEVELOPER=true brew bump-formula-pr --url=https://github.com/nodenv/node-build/archive/v2.6.12.tar.gz --sha256=b0983958ad0dcb746a252473ea20ff1bcccbe200a42ed3332345d350d60b8c41 node-build
Already up-to-date.
==> replace "https://github.com/nodenv/node-build/archive/v2.6.11.tar.gz" with "https://github.com/nodenv/node-build/archive/v2.6.12.tar.gz"
==> replace "266170f2a56100125e7a76565ef0796017b3c45891e56db76bd2b233b201194e" with "b0983958ad0dcb746a252473ea20ff1bcccbe200a42ed3332345d350d60b8c41"
M	Formula/node-build.rb
Switched to a new branch 'node-build-2.6.12'
[node-build-2.6.12 65ce9bde1f] node-build 2.6.12
 1 file changed, 2 insertions(+), 2 deletions(-)
Error: cannot get remote from 'hub'!
$ hub --version
git version 2.14.1
hub version 2.3.0-pre10-g2d34517

@mislav
Copy link
Sponsor Contributor Author

mislav commented Sep 8, 2017 via email

@jasonkarns
Copy link
Contributor

No biggie. Easy enough to quickly switch back to latest real release before running brew command. Mainly just posting as an FYI that --devel and --HEAD behave the same now.

@ilovezfs
Copy link
Contributor

ilovezfs commented Sep 8, 2017

@jasonkarns HEAD is fine if you pull this PR locally. It hasn't shipped yet.

brew pull https://github.com/Homebrew/brew/pull/3061

@jasonkarns
Copy link
Contributor

ah, my bad. disregard :(

@MikeMcQuaid MikeMcQuaid merged commit 929edca into Homebrew:master Sep 8, 2017
@MikeMcQuaid
Copy link
Member

Thanks @mislav! Merging this as-is for now as at least it fixes some cases.

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants