Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Aug 2020 17:29:00 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        "Sideropoulos, Alexander" <Alexander.Sideropoulos@netapp.com>, freebsd-git@freebsd.org, "Maxwell, Larus" <Larus.Maxwell@netapp.com>
Subject:   Re: SVN Revision-Like IDs in Git
Message-ID:  <CAPyFy2BjOn32iDyNR0mpuPz7Q4BRFAy2bzW4z-ez7qxEE46uTA@mail.gmail.com>
In-Reply-To: <CANCZdfoh85FWJ5wfkDAZzxKwcAwTTy7Dht4BUHJ=JT_L7pDH8g@mail.gmail.com>
References:  <013F16E7-DDBB-4C2F-829D-D08B53CC7585@netapp.com> <CANCZdfoh85FWJ5wfkDAZzxKwcAwTTy7Dht4BUHJ=JT_L7pDH8g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 6 Aug 2020 at 21:27, Warner Losh <imp@bsdimp.com> wrote:
>
> On Thu, Aug 6, 2020, 4:01 PM Sideropoulos, Alexander <
> Alexander.Sideropoulos@netapp.com> wrote:
>
> > Hey folks,
> >
> > According to this page...
> >
> > https://hackmd.io/_lvyl1CfTsayB3L0v4fmLA#What%E2%80%99s-with-the-funny-revision-hashes-I-want-revision-numbers
> >
> > ...there are no plans to provide an SVN-revision-like ID for Git commits
> > once the switch-over happens.
> >
> > At NetApp, we rely on the SVN revision number to uniquely identify our
> > FreeBSD baseline and every cherry-picked patch we apply on top of it. We
> > could update all our tooling to accept Git hashes, but this is not a small
> > task. And I imagine we are not the only downstream project reliant upon SVN
> > revision numbers.
> >
> > Since the SVN revision ID is really just an arbitrary number, has there
> > been any thought in simply continuing to manufacture these numbers for Git
> > commits going forward? It could even be a post-commit operation where the
> > Git notes are updated with a unique (increasing) ID, just as is done today.
> >
> > Thoughts?
> >
>
> Git has the ability to generate a number of commits since the last tag (or
> maybe arbitrary tag). That is appropriately the same thing if you don't
> need temporal stability between branches...

Git has a "generation number" that could be used for this purpose, but
unfortunately it isn't exposed in a user-facing way. It is possible to
count the number of commits from the root to the current head though,
and we include this number in the uname if build from git today. It
appears as a "-cXXXXXX" suffix. As long as you are tracking or
comparing only within a branch (e.g. stable/12) as Warner says it can
be used equivalently.

In sys/conf/newvers.sh have a look at the block following the "if [ -n
"$git_cmd" ] ; then"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2BjOn32iDyNR0mpuPz7Q4BRFAy2bzW4z-ez7qxEE46uTA>