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

2 messages, 2 authors, 2016-12-05 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-12-05 18:10:13

Ramsay Jones [off-list ref] writes:
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.

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

From: Ramsay Jones <hidden>
Date: 2016-12-05 20:31:09


On 05/12/16 18:10, Junio C Hamano wrote:
Ramsay Jones [off-list ref] writes:
quoted
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"?
As I said, the original version of the patch just removed the
--abbrev=7, but then I started to think about why you might have
used --abbrev in the first place (first in commit 9b88fcef7 and
again in commit bf505158d). Making sure to override the configuration
was the only thing I could come up with. So, I was hoping you could
remember why! :-P

(I assumed it was to force a measure of uniformity/reproducibility).

ATB,
Ramsay Jones

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help