Re: [RFC PATCH] GIT-VERSION-GEN: set --abbrev=9 to match auto-scaling
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Dec 5, 2016, 11:21 UTC
- Message-ID
- <ab1e7ce9-1022-0c72-2f72-63e3b9182bc9@ramsayjones.plus.com>
- In-Reply-To
- <20161205053258.jtnqq64gp5n7vtni@sigill.intra.peff.net>
On 05/12/16 05:32, Jeff King wrote:
Show 18 quoted lines
> On Sun, Dec 04, 2016 at 08:45:59PM +0000, Ramsay Jones wrote: >> I recently noticed that: >> >> $ make >pout 2>&1 >> $ ./git version >> git version 2.11.0.286.g109e8a9 >> $ git describe >> v2.11.0-286-g109e8a99d >> $ >> >> ... for non-release builds, the commit part of the version >> string was still using an --abbrev=7. > > It seems like this kind of discussion ought to go in the commit message. > :) > > That said, I think the right patch may be to just drop --abbrev > entirely.
Heh, that was the first version of the patch. However, I got to thinking about why --abbrev=7 was there in the first place; the only reason I could think of was to defeat local configuration to get a measure of reproducibility.
Unfortunately, you can't get the 'auto' behaviour from --abbrev (on the pu branch):
$ ./git describe --abbrev=-1
v2.11.0-286-g109e8
$ ./git describe --abbrev=0
v2.11.0
$ ./git describe
v2.11.0-286-g109e8a99d
$I did think about using '-c core.abbrev=auto', but that would depend on Junio's patch (nothing wrong with that, of course):
$ git version
git version 2.11.0
$ git -c core.abbrev=auto describe
fatal: bad numeric config value 'auto' for 'core.abbrev': invalid unit
$ ./git -c core.abbrev=auto describe
v2.11.0-286-g109e8a99d
$ What do you think?
ATB, Ramsay Jones