From: Simon Tournier <zimon.toutoune@gmail.com>
To: Giovanni Biscuolo <g@xelera.eu>,
Jonathan Brielmaier <jonathan.brielmaier@web.de>,
63775-close@debbugs.gnu.org
Cc: guix-devel@gnu.org
Subject: Re: bug#63775: git describe on current master says: v1.3.0-38775-g6192acf8b7
Date: Mon, 12 Feb 2024 10:17:17 +0100 [thread overview]
Message-ID: <871q9i2g9u.fsf@gmail.com> (raw)
In-Reply-To: <87le81bd8d.fsf@xelera.eu>
Hi,
On sam., 03 févr. 2024 at 19:43, Giovanni Biscuolo <g@xelera.eu> wrote:
> This is a git bug, not an issue with our repo, and for this reason (I
> hope) I'm closing this bug; please see below.
Here the explanation of the bug of “git describe”:
https://lore.kernel.org/git/20191008123156.GG11529@szeder.dev/
$ git describe d1a251a1fa
v2.23.0-135-gd1a251a1fa
$ git log --oneline v2.23.0..d1a251a1fa | wc -l
59
Uh-oh, 59 != 135.
This is happening because:
- Git is too fast ;) and the committer date has a one second
granularity, so scripts can easily create subsequent commits with
the same committer date. Case in point are the two subsequent
merge commits f3c19f85c5 and 4a3ed2bec6 at the bottom of this
simplified history snippet (kind of a hand-edited 'git log --graph
--format="%h %cd %s"'):
* d1a251a1fa 2019-09-09 12:26:36 -0700 Merge branch 'en/checkout-mismerge-fix'
|\
* | ... a big chunk of history simplified away ...
| * acb7da05ac 2019-08-16 09:58:00 -0700 checkout: remove duplicate code
* | a5e4be2f68 2019-04-25 16:41:15 +0900 Merge branch 'ab/commit-graph-fixes'
* | f3c19f85c5 2019-04-25 16:41:14 +0900 Merge branch 'ab/gc-reflog'
|/
* 4a3ed2bec6 2019-04-25 16:41:14 +0900 Merge branch 'nd/checkout-m'
- 'git describe' implements its own history traversal: it iterates
over all parents of a commit, adds any yet unseen parents to a
commit list ordered by date, and then continues with the first,
i.e. most recent commit from that list. While doing so it uses
several bits in 'commit->object.flags' to track reachability
information from several candidate tags at once, and copies these
flags from each commit to its parents; this is important to
compute the correct number of additional commits. Another
important thing is the implementation detail that
commit_list_insert_by_date() inserts a new commit after all other
commits with the same date that are already in the list.
Thanks Giovanni for pointing this out.
Cheers,
simon
prev parent reply other threads:[~2024-02-12 13:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87pm6k5vwn.fsf@gnu.org>
[not found] ` <dc1000b2-6c9f-4a84-ab59-4bab8fec8ef2@web.de>
2024-02-03 18:43 ` bug#63775: git describe on current master says: v1.3.0-38775-g6192acf8b7 Giovanni Biscuolo
2024-02-05 11:08 ` consider "git describe"... harmful? (if misused) Giovanni Biscuolo
2024-02-12 9:17 ` Simon Tournier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q9i2g9u.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=63775-close@debbugs.gnu.org \
--cc=g@xelera.eu \
--cc=guix-devel@gnu.org \
--cc=jonathan.brielmaier@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).