# git describe not matching git log

2 messages from 2012-11-29 to 2012-11-29. Participants: Steven Penny, Michael J Gruber.
Thread: https://gitlist.dev/t/32238

## Steven Penny, 2012-11-29 09:04

Subject: git describe not matching git log
Message-ID: <CAAXzdLWNb7E1qincviX5y_uEsT71bbepuUtLR7Q_+Exm8Od6yw@mail.gmail.com>
URL: https://gitlist.dev/e/CAAXzdLWNb7E1qincviX5y_uEsT71bbepuUtLR7Q_%2BExm8Od6yw%40mail.gmail.com

```
It seems "git describe" is not matching "git log" as detailed in the help, in
some cases. From git describe --help

  [torvalds@g5 git]$ git describe parent
  v1.0.4-14-g2414721

  The number of additional commits is the number of commits which would
  be displayed by "git log v1.0.4..parent".

GOOD

  $ git clone git://github.com/antirez/redis.git

  $ cd redis

  $ git describe unstable
  with-deprecated-diskstore-1050-g7383c3b

  $ git log --oneline with-deprecated-diskstore..unstable | wc
     1050   11779   78709

BAD

  $ git clone git://github.com/git/git.git

  $ cd git

  $ git describe master
  v1.8.0.1-264-g226dcb5

  $ git log --oneline v1.8.0.1..master | wc
      260    1650   14154

```

## Michael J Gruber, 2012-11-29 14:06

Subject: Re: git describe not matching git log
Message-ID: <50B76BF3.1090104@drmicha.warpmail.net>
URL: https://gitlist.dev/e/50B76BF3.1090104%40drmicha.warpmail.net
In-Reply-To: <CAAXzdLWNb7E1qincviX5y_uEsT71bbepuUtLR7Q_+Exm8Od6yw@mail.gmail.com>

```
Steven Penny venit, vidit, dixit 29.11.2012 10:04:
> It seems "git describe" is not matching "git log" as detailed in the help, in
> some cases. From git describe --help
> 
>   [torvalds@g5 git]$ git describe parent
>   v1.0.4-14-g2414721
> 
>   The number of additional commits is the number of commits which would
>   be displayed by "git log v1.0.4..parent".
> 
> GOOD
> 
>   $ git clone git://github.com/antirez/redis.git
> 
>   $ cd redis
> 
>   $ git describe unstable
>   with-deprecated-diskstore-1050-g7383c3b
> 
>   $ git log --oneline with-deprecated-diskstore..unstable | wc
>      1050   11779   78709
> 
> BAD
> 
>   $ git clone git://github.com/git/git.git
> 
>   $ cd git
> 
>   $ git describe master
>   v1.8.0.1-264-g226dcb5
> 
>   $ git log --oneline v1.8.0.1..master | wc
>       260    1650   14154
> 

This is due to date skew: git-describe uses "insert_by_date" when it
traverses the dag, and this can go wrong.

Interestingling, this seems to get fixed by using Jeff's generation
numbers and "insert_by_generation" instead, so it does seem go wrong for
226dcb5~60 or so. git-describe's logic is a bit convoluted and may
depend on how we insert when generation numbers are the same... Have to
do more testing.

Michael

```
