git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* Possible bug in git describe, additional commits differs when cloned with --depth
@ 2019-09-27  9:51 Anders Janmyr
  2019-09-27 12:02 ` SZEDER Gábor
  0 siblings, 1 reply; 3+ messages in thread
From: Anders Janmyr @ 2019-09-27  9:51 UTC (permalink / raw)
  To: git

Hi,

I'm not sure if this is a bug or not but `git describe` gives
different results when the repo has been cloned with `--depth` or not.

In the example below from the git repository the number of additional
commits since the
last tag differs 256 vs. 265.

```
$ git clone https://github.com/git/git
$ cd git/
$ git describe
v2.23.0-256-g4c86140027
$ git rev-list -n 1 HEAD
4c86140027f4a0d2caaa3ab4bd8bfc5ce3c11c8a


$ git clone --depth=50 https://github.com/git/git git-depth
$ cd git-depth/
$ git describe
v2.23.0-265-g4c861400
$ git rev-list -n 1 HEAD
4c86140027f4a0d2caaa3ab4bd8bfc5ce3c11c8a
```

In the example above the first version also gives additional digits
for the SHA,
g4c86140027 vs. g4c861400, but that is not always the case.

I came upon this discrepancy when using the value from `git describe`
in a build pipeline
where the system optimized the build by cloning the repo using `--depth`.

Kind regards
--
http://anders.janmyr.com/
@andersjanmyr
+46 733-99 03 60

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27  9:51 Possible bug in git describe, additional commits differs when cloned with --depth Anders Janmyr
2019-09-27 12:02 ` SZEDER Gábor
2019-10-08 12:31   ` [BUG] a commit date-related bug in 'git describe' [was: Re: Possible bug in git describe, additional commits differs when cloned with --depth] SZEDER Gábor

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git