# [bug] docs claim git fetch --deepen doesn't fetch tags, but it does

1 messages from 2022-06-01 to 2022-06-01. Participants: Tim Cuthbertson.
Thread: https://gitlist.dev/t/57940

## Tim Cuthbertson, 2022-06-01 12:39

Subject: [bug] docs claim git fetch --deepen doesn't fetch tags, but it does
Message-ID: <CAC-LLDiu9D7Ea-HaAsR4GO9PVGAeXOc8aRoebCFLgDKow=hPTQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAC-LLDiu9D7Ea-HaAsR4GO9PVGAeXOc8aRoebCFLgDKow%3DhPTQ%40mail.gmail.com

```
The docs for git fetch `--depth` say:

> Tags for the deepened commits are not fetched.

And shallow.txt says:

> - If you deepen a history, you'd want to get the tags of the
> newly stored (but older!) commits. This does not work right now.

However it seems like this has been implemented, and the corresponding
docs should instead declare that tags for the fetched commits are
fetched. It certainly looks that way from my testing:

ˋˋˋ
$ git --version
git version 2.32.1 (Apple Git-133)

$ git clone --depth=1 https://github.com/git/git
Cloning into 'git'...
# < ... >

$ cd git

$ git describe --tags --always
1bcf4f6

$ git fetch --deepen 8
# < ... >
Unpacking objects: 100% (12/12), 9.02 KiB | 9.02 MiB/s, done.
From https://github.com/git/git
* [new tag] v2.31.3 -> v2.31.3
* [new tag] v2.32.1 -> v2.32.1
* [new tag] v2.32.2 -> v2.32.2
* [new tag] v2.33.2 -> v2.33.2
* [new tag] v2.33.3 -> v2.33.3
* [new tag] v2.34.1 -> v2.34.1
* [new tag] v2.34.2 -> v2.34.2
* [new tag] v2.34.3 -> v2.34.3
* [new tag] v2.35.1 -> v2.35.1
* [new tag] v2.35.2 -> v2.35.2
* [new tag] v2.35.3 -> v2.35.3
* [new tag] v2.36.0 -> v2.36.0

$ git describe --tags --always
v2.35.3-35-g1bcf4f6
ˋˋˋ

(I get the same results using `git clone --depth` or `git fetch --depth`)

It'd be good to have someone who understands the code confirm this
(and what version it was implemented, in case it's accidental, or
doesn't always work as expected.

I found a stackoverflow from a couple years ago implying this didn't
work at the time, though it doesn't say what git version they were
using:
https://stackoverflow.com/questions/56477321/can-i-make-git-fetch-a-repository-tag-list-without-actually-pulling-the-commit-d

```
