git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] GIT-VERSION-GEN: set --abbrev=9 to match auto-scaling

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 5, 2016, 18:10 UTC
Message-ID
<xmqq7f7e5jsy.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<ab1e7ce9-1022-0c72-2f72-63e3b9182bc9@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
Show 15 quoted lines
> 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
>     $

What is the reason why the last one is undesirable? Is it because the user may have core.abbrev set to some value in the configuration and you want to override it to force "auto"?

I am not sure how rigid GIT-VERSION-GEN wants to be to countermand such an explicit user preference (i.e. existing configuration).

> I did think about using '-c core.abbrev=auto', 

Having said that, if countermanding end-user's configuration is desireble, I agree that "-c core.abbrev=auto" is the way to do so.

> but that would depend on Junio's patch (nothing wrong with that,
> of course):

You caught me. I'll need to polish that into a usable shape soon then. And that is orthogonal to the "does it make sense to force 'auto' in this context?" question.

Previous: Ramsay JonesNext: Ramsay Jones
Message 4 of 12 in “GIT-VERSION-GEN: set --abbrev=9 to match auto-scaling”
  1. GIT-VERSION-GEN: set --abbrev=9 to match auto-scalingRamsay Jones, Dec 4, 2016
  2. Jeff KingDec 5, 2016
  3. Ramsay JonesDec 5, 2016
  4. Junio C HamanoDec 5, 2016
  5. Ramsay JonesDec 5, 2016
  6. Junio C HamanoDec 5, 2016
  7. Ramsay JonesDec 5, 2016
  8. Junio C HamanoDec 5, 2016
  9. Jeff KingDec 6, 2016
  10. Junio C HamanoDec 6, 2016
  11. Jeff KingDec 6, 2016
  12. Ramsay JonesDec 6, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.