Re: [PATCH] describe: output tag's ref instead of embedded name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 19, 2020 at 03:14:14AM -0800, Junio C Hamano wrote:

> Jeff King <peff@xxxxxxxx> writes:
> 
> > I think a left a few things unsaid in my "v1.0-bob" example. I was
> > imagining that there are _two_ v1.0 tags floating around. One that you
> > consider "wrong", tagged by Bob, and one you like. You keep the latter
> > in refs/tags/v1.0.
> 
> Ahh, OK.  
> 
> To continue playing devil's advocate and to step back a bit,
> 
>  - The "git describe" command finds that the given commit is
>    "closest" to that tag Bob called "v1.0".
> 
>  - But if it outputs "v1.0" like the current code does, it cannot be
>    fed back to get_oid() to name the right object, if the given commit
>    is "at" the tag (i.e. there is no "-$number-g$objectname" suffix),
>    which is a problem.  We want "git describe" to give an output
>    usable with get_oid() and the name must refer to the correct
>    object (i.e. the one given to "git describe" as an input).
> 
> There are multiple approaches to make it possible to feed the output
> back to get_oid() to obtain correct result:
> [...]

Thanks for clearly laying out your thinking. All of what you wrote makes
sense to me and I'd be OK with any of the options you described.

The "-g$objectname" one is kind of clever, and definitely not something
I had thought of. We already have "--long", and of course we'd show the
long version for any name that isn't an exact match anyway. So as an
added bonus, it seems unlikely to surprise anybody who is expecting the
current "show the tag, not the refname" output (though again, this is
rare enough that I think people simply expect them to be the same ;) ).

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux