-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[update-checkout] Skip fetching tags when --skip-tags is passed #79814
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
base: main
Are you sure you want to change the base?
Conversation
The existing --skip-tags option only affected cloning new repos. This skips fetching tags in already cloned repos as well.
@swift-ci please test |
@swift-ci python lint |
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.
Thank you!
shell.run(["git", "fetch", "--recurse-submodules=yes", | ||
"--tags"], | ||
f"{checkout_target}:{checkout_target}"], | ||
echo=True, prefix=prefix) |
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.
The refspec will not work with hashes or tags, and I believe it is better not to proactively create local branches if the target is a branch. I also think we still want to respect skip_tags
here.
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.
Hmm yeah, this bit turned out to be trickier than I expected... The method for fetching a single tag is different from fetching a single branch, but it doesn't seem like the script knows whether checkout_target
is a tag or a branch. Since this fetch is explicitly done because checkout_target
wasn't found locally, it seems like simply skipping --tags
here when --skip-tags
is passed will lead to more errors than not. So it'd be good if we could fetch a just a single tag when needed.
Is this testable at all? |
Totally is, we have the infrastructure. I even have a test for this exact case in a dusty worktree along with a bunch of others that I have been planning to stage in for a while. |
The existing --skip-tags option only affects cloning new repos. This skips fetching tags in already cloned repos as well.