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

Run 'git fetch' with '--force' if no revision given #237

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

snim2
Copy link
Contributor

@snim2 snim2 commented Mar 11, 2024

When we run git fetch without a specific revision we usually run it with --all which fetches tags (among other things).

We now have movable tags in our plugin repositories and when a tag is moved a git fetch or checkout will produce a 'would clobber existing tag' error on the command line, which warns the user that the tag that has already been checked into the local clone will be overwritten.

This commit fixes that error by running fetch with --force if we do not specify a revision.

Testing

This can only be tested if you have a repo checked out with a major revision tag of a plugin which has been moved, in which case you will see would clobber existing tag when you run whippet deps update. At this point, you can try the same thing with this branch and see if that fixes the issue.

Merge checklist

  • Includes tests (if new features are introduced)
  • Commit message includes link to the ticket/issue
  • Changelog updated
  • PR open against dxw's Homebrew Tap to point the Whippet formula to the new version number

@snim2 snim2 force-pushed the fix/would-clobber-existing-tag-on-fetch branch from bea0d2f to 01a63f8 Compare March 11, 2024 18:14
@snim2 snim2 marked this pull request as ready for review March 11, 2024 18:15
@snim2 snim2 force-pushed the fix/would-clobber-existing-tag-on-fetch branch from 01a63f8 to 5ba0a83 Compare March 11, 2024 18:15
@snim2 snim2 added bug module/dependencies php Pull requests that update Php code labels Mar 11, 2024
When we run 'git fetch' without a specific revision we
usually run it with '--all' which fetches tags (among
other things).

We now have movable tags in our plugin repositories
and when a tag is moved a 'git fetch' or 'checkout'
will produce a 'would clobber existing tag' error on
the command line, which warns the user that the tag
that has already been checked into the local clone
will be overwritten.

This commit fixes that error by running 'fetch' with
'--force' if we do not specify a revision.
@snim2 snim2 force-pushed the fix/would-clobber-existing-tag-on-fetch branch from 5ba0a83 to b1a4613 Compare March 11, 2024 18:40
Copy link

@brent-dxw brent-dxw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@snim2 snim2 merged commit bf78cd5 into main Mar 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug module/dependencies php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants