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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux