-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Expected Behavior
When fetch-tags is set to true, the --tags flag is appended to the underlying git fetch operation:
-git fetch
+git fetch --tagsActual Behavior
When fetch-tags is set to true, the --tags flag is NOT appended to the underlying git fetch operation.
Notes
It appears that the only behavior change that this option introduces is the addition of the --no-tags flag when the fetch-tags option is set to false (which is its default):
checkout/src/git-command-manager.ts
Lines 288 to 290 in 71cf226
| if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) { | |
| args.push('--no-tags') | |
| } |
I find this behavior misleading, given that these are the typical tag behaviors of git fetch:
| Operation | Behavior |
|---|---|
git fetch |
Any tag that points into the histories being fetched is also fetched1 |
git fetch --tags |
Fetches all tags from the remote2 |
git fetch --no-tags |
Disables automatic tag following3 |
It seems like the existing behavior of this option would be more appropriately named no-fetch-tags/no-tags/etc.
Change Request
- Deprecate the
fetch-tagsoption. - Add a
tagsoption (or perhapstags-behavior?) that can be set to one of the following:follow(default)allnone
I'd be happy to implement this behavior in a pull request if that would be welcome!
Related Issues
- allow fetch tags too #701
- Can't fetch with
fetch-tagswhen triggered by tag #1467 - fetch-tags: true doesn't actually fetch any tags #1471
- fetch-tags=true do not work when fetch-depth > 0 #1662
- fetch-tags is not working according to the docs with v4 #1781
- Tags no longer fetch with Git v2.48.0 #2041
- fetch-tags: false still fetches tags if fetch-depth is 0 #2195
fetch-tags: truedoesn't work #2199