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

Fix `bump-formula-pr` when working with a shallow git clone #2829

Merged
merged 3 commits into from Jul 1, 2017

Conversation

Projects
None yet
3 participants
@mislav
Copy link
Contributor

mislav commented Jun 27, 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?

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.

/cc @MikeMcQuaid

Fix `bump-formula-pr` when working with a shallow git clone
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.
@@ -296,6 +297,7 @@ def bump_formula_pr
ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
ohai "git checkout -"
else
safe_system "git", "fetch", "--unshallow", "origin"

This comment has been minimized.

@mislav

mislav Jun 27, 2017

Contributor

Optionally, we chould conditionally perform --unshallow only if the git repository was shallow to begin with. However, since brew update ran just prior to this, this should return fast if there's nothing to do. Let me know what you think is best.

@ilovezfs

This comment has been minimized.

Copy link
Contributor

ilovezfs commented Jun 27, 2017

==> replace /https:\/\/github\.com\/fsprojects\/Paket\/releases\/download\/5\.2\.1\/paket\.exe/ with "https://github.com/fsprojects/Paket/releases/download/5.2.2/paket.exe"
==> replace "c59ea7abc167c3553eb36d7a140ea4218309368263d09b869b5225233eb17a28" with "26676be1f0c3a75fe4aa450f619863604262d9f5d9e063bac433945c907783ca"
fatal: --unshallow on a complete repository does not make sense
Error: Failure while executing: git fetch --unshallow origin

You may want to use brew tap --full for this.

Fix unshallowing taps in `bump-formula-pr`
Never try to unhshallow full clones.
@mislav

This comment has been minimized.

Copy link
Contributor

mislav commented Jun 27, 2017

@ilovezfs Thanks for trying this out. Now changed to conditionally unshallow repos only when necessary.

@MikeMcQuaid

This comment has been minimized.

Copy link
Member

MikeMcQuaid commented Jun 29, 2017

Ugh, CI failing on RuboCop stuff I should probably just disable at this point.

@MikeMcQuaid

This comment has been minimized.

Copy link
Member

MikeMcQuaid commented Jun 29, 2017

Thanks @mislav! Will let @ilovezfs merge if he's 👍

@@ -286,7 +286,11 @@ def bump_formula_pr

formula.path.parent.cd do
branch = "#{formula.name}-#{new_formula_version}"
git_dir = Utils.popen_read("git rev-parse --git-dir")

This comment has been minimized.

@ilovezfs

ilovezfs Jun 29, 2017

Contributor

This needs .chomp

This comment has been minimized.

@mislav

mislav Jun 29, 2017

Contributor

Good catch! Fixed

@ilovezfs ilovezfs merged commit a94a938 into Homebrew:master Jul 1, 2017

2 of 3 checks passed

codecov/patch 0% of diff hit (target 65.8%)
Details
codecov/project 65.8% (+<.01%) compared to 4fb60d8
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ilovezfs

This comment has been minimized.

Copy link
Contributor

ilovezfs commented Jul 1, 2017

Thanks @mislav!

@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.