{"thread":{"id":"57940","subject":"[bug] docs claim git fetch --deepen doesn't fetch tags, but it does","startedAt":"2022-06-01T12:52:50Z","lastAt":"2022-06-01T12:52:50Z","messageCount":1,"participants":["Tim Cuthbertson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"456442","messageId":"CAC-LLDiu9D7Ea-HaAsR4GO9PVGAeXOc8aRoebCFLgDKow=hPTQ@mail.gmail.com","threadId":"57940","inReplyTo":null,"subject":"[bug] docs claim git fetch --deepen doesn't fetch tags, but it does","fromName":"Tim Cuthbertson","fromEmail":"tim@gfxmonk.net","sentAt":"2022-06-01T12:39:53Z","receivedAt":"2022-06-01T12:52:50Z","isPatch":false,"sender":{"key":"tim@gfxmonk.net","avatar":null},"body":"The docs for git fetch `--depth` say:\n\n> Tags for the deepened commits are not fetched.\n\nAnd shallow.txt says:\n\n> - If you deepen a history, you'd want to get the tags of the\n> newly stored (but older!) commits. This does not work right now.\n\nHowever it seems like this has been implemented, and the corresponding\ndocs should instead declare that tags for the fetched commits are\nfetched. It certainly looks that way from my testing:\n\n```\n$ git --version\ngit version 2.32.1 (Apple Git-133)\n\n$ git clone --depth=1 https://github.com/git/git\nCloning into 'git'...\n# < ... >\n\n$ cd git\n\n$ git describe --tags --always\n1bcf4f6\n\n$ git fetch --deepen 8\n# < ... >\nUnpacking objects: 100% (12/12), 9.02 KiB | 9.02 MiB/s, done.\nFrom https://github.com/git/git\n* [new tag] v2.31.3 -> v2.31.3\n* [new tag] v2.32.1 -> v2.32.1\n* [new tag] v2.32.2 -> v2.32.2\n* [new tag] v2.33.2 -> v2.33.2\n* [new tag] v2.33.3 -> v2.33.3\n* [new tag] v2.34.1 -> v2.34.1\n* [new tag] v2.34.2 -> v2.34.2\n* [new tag] v2.34.3 -> v2.34.3\n* [new tag] v2.35.1 -> v2.35.1\n* [new tag] v2.35.2 -> v2.35.2\n* [new tag] v2.35.3 -> v2.35.3\n* [new tag] v2.36.0 -> v2.36.0\n\n$ git describe --tags --always\nv2.35.3-35-g1bcf4f6\n```\n\n(I get the same results using `git clone --depth` or `git fetch --depth`)\n\nIt'd be good to have someone who understands the code confirm this\n(and what version it was implemented, in case it's accidental, or\ndoesn't always work as expected.\n\nI found a stackoverflow from a couple years ago implying this didn't\nwork at the time, though it doesn't say what git version they were\nusing:\nhttps://stackoverflow.com/questions/56477321/can-i-make-git-fetch-a-repository-tag-list-without-actually-pulling-the-commit-d\n"}]}