-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Force fetch tags on checkout local working clone #2184
Conversation
This makes me nervous because it will apply to all refs fetched from the origin, not just the tag. That makes me think perhaps we should pull the specific tag, with a |
This is already the case if I am reading the man page correctly.
|
2fc3a71
to
1605db2
Compare
Since |
b0d0560
to
3a26f73
Compare
In Git 2.20 "git fetch" was taught to forbid updates to existing tags without the "--force" option[1]. As Flux force-pushes a tag all the time to keep track of the sync state, this would sometimes lead to 'would clobber existing tag' errors while making sure a fresh checkout was up-to-date with its mirror, as described issue 2169[2]. To prevent this from happening: force fetch all tags from the mirror while creating the local working clone, and _before_ fetching anything else. NB: We only have to do this while creating a working clone from a mirror, as a mirror (bare clone) will accept non-fast-forward tag changes from remote. [1]: https://github.com/git/git/blob/master/Documentation/RelNotes/2.20.0.txt#L67-L71 [2]: #2169
3a26f73
to
61fdf95
Compare
@squaremo this should be it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's tricky to reproduce the original problem, but I think this does on paper address it.
It also behaves the same as before otherwise, as far as I can tell from actually trying it. So 👍
Force fetch tags on checkout local working clone
In Git 2.20 "git fetch" was taught to forbid updates to existing tags
without the "--force" option1. As Flux force-pushes a tag all the
time to keep track of the sync state, this would sometimes lead to
'would clobber existing tag' errors while making sure a fresh checkout
was up-to-date with its mirror, as described issue 21692.
To prevent this from happening: force fetch all tags from the mirror
while creating the local working clone, and before fetching anything
else.
NB: We only have to do this while creating a working clone from a
mirror, as a mirror (bare clone) will accept non-fast-forward tag
changes from remote.
Fixes #2169