Skip to content

fetch tags when fetch-depth > 0. fix #1781#2039

Closed
andreineculau wants to merge 1 commit intoactions:mainfrom
andreineculau-forks:patch-1
Closed

fetch tags when fetch-depth > 0. fix #1781#2039
andreineculau wants to merge 1 commit intoactions:mainfrom
andreineculau-forks:patch-1

Conversation

@andreineculau
Copy link
Copy Markdown

fixes #1781

@andreineculau andreineculau requested a review from a team as a code owner January 14, 2025 18:49
if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
args.push('--no-tags')
if (options.fetchTags) {
args.push('--tags')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this won't work.
the bug in git cause the --tags get ignored when we pass any refspec.

19:38:51.501221 git.c:476               trace: built-in: git fetch --prune --no-recurse-submodules --depth=1 --tags origin +dafa907d050b7aca612cb1fc3262cbe1157a41d4:refs/remotes/origin/main
From https://github.com/TingluoHuang/repo-3208316
 + 2e53bff...dafa907 dafa907d050b7aca612cb1fc3262cbe1157a41d4 -> origin/main  (forced update)

vs older git version

19:45:56.613886 git.c:479               trace: built-in: git fetch --prune --no-recurse-submodules --depth=1 --tags origin +dafa907d050b7aca612cb1fc3262cbe1157a41d4:refs/remotes/origin/main
From https://github.com/TingluoHuang/repo-3208316
 + 5b6b8cc...dafa907 dafa907d0[50](https://github.com/TingluoHuang/repo-3208316/actions/runs/13315815917/job/37189415774#step:4:51)b7aca612cb1fc3262cbe1157a41d4 -> origin/main  (forced update)
 * [new tag]         v13315501148                             -> v13315501148
 * [new tag]         v13315557600                             -> v13315557600
 * [new tag]         v13315584914                             -> v13315584914
 * [new tag]         v13315601791                             -> v13315601791
 * [new tag]         v133156378[52](https://github.com/TingluoHuang/repo-3208316/actions/runs/13315815917/job/37189415774#step:4:53)                             -> v13315637852
 * [new tag]         v13315718561                             -> v13315718561
 * [new tag]         v13315732428                             -> v13315732428
 * [new tag]         v13315782509                             -> v13315782509

@andreineculau
Copy link
Copy Markdown
Author

presumably fixed #1781 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetch-tags is not working according to the docs with v4

3 participants