Re: [PATCH] describe: output tag's ref instead of embedded name
- From
Jeff King <peff@peff.net>
- Date
- Feb 21, 2020, 06:00 UTC
- Message-ID
- <20200221060029.GF1280313@coredump.intra.peff.net>
- In-Reply-To
- <xmqqsgj47l0k.fsf@gitster-ct.c.googlers.com>
On Thu, Feb 20, 2020 at 06:05:15PM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> Matheus Tavares <matheus.bernardino@usp.br> writes: > > >> > Another case that came to my mind is when the user runs `git describe > >> > --abrev=0 HEAD` and v1.0-bob points to HEAD~. In this case, v1.0 will > >> > be displayed without suffix,... > >> > >> In this case, v1.0-1- is followed by the full object name, I think. > > > > I might be doing something wrong, but this is how I tried to test this:... > > I only tried the commit exactly at the tag "describe --abbrev=0 v1.0-bob^0"; > you're right---the "abbrev" option strips the suffix in a separate codepath. > > > Then we cannot directly use the output. I think we can fix this forcing the long > > output for this case as well, which can be done with: > > Thanks for a quick fix on top.
This fix makes sense. There's already a bit of ambiguity with --no-abbrev, as it would output v1.0-1-g1234abcd as just "v1.0". But it probably is best to draw the line here and not introduce even more ambiguity.
-Peff