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

Re: [PATCH 2/2] tag: do not show ambiguous tag names as "tags/foo"

From
Karthik Nayak <karthik.188@gmail.com>
Date
Jan 26, 2016, 04:25 UTC
Message-ID
<CAOLa=ZRWGHf=Q3L6x5wf1Aiy2Q=T2117+YGPxMxM-weYkC+CoQ@mail.gmail.com>
In-Reply-To
<xmqq60yhdx4v.fsf@gitster.mtv.corp.google.com>
On Tue, Jan 26, 2016 at 5:34 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 45 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> Since b7cc53e9 (tag.c: use 'ref-filter' APIs, 2015-07-11),
>> git-tag has started showing tags with ambiguous names (i.e.,
>> when both "heads/foo" and "tags/foo" exists) as "tags/foo"
>> instead of just "foo". This is both:
>>
>>   - pointless; the output of "git tag" includes only
>>     refs/tags, so we know that "foo" means the one in
>>     "refs/tags".
>>
>> and
>>
>>   - ambiguous; in the original output, we know that the line
>>     "foo" means that "refs/tags/foo" exists. In the new
>>     output, it is unclear whether we mean "refs/tags/foo" or
>>     "refs/tags/tags/foo".
>>
>> The reason this happens is that commit b7cc53e9 switched
>> git-tag to use ref-filter's "%(refname:short)" output
>> formatting, which was adapted from for-each-ref.
>> ...
>
> Karthik, getting a fix in for "git tag" regression is more important
> than the topics parked in 'pu', so I'll queue this patch in the
> early part of 'pu'.
>
> I personally feel that "refname:strip=<n>" would be a good mechanism
> for end users to specify a custom format, and it is unclear to me
> what should happen when there are not enough elements to be
> stripped, so I do not think we want to cast the "we will show the
> whole thing" decision in stone prematurely only because we want to
> push out the regression fix soon.  So I may ask Jeff to rework this
> one (or I may end up trying to do so myself) not to squat on the
> nice strip=<n> notation.  refname:strip-standard-prefix that removes
> the known prefix ("refs/heads", "refs/remotes" and "refs/tags") if
> present and does not touch the refname otherwise would leave us more
> time to decide what strip=<n> should do in the error case.
>
> Unfortunately, this means kn/ref-filter-atom-parsing topic from you
> that were parked on 'pu' must be ejected for now, as any change in
> this area overlaps with it, and the atom parsing code would need to
> be updated to learn about the new attribute of the 'refname' atom
> (be it 'remove-prefix=<glob>', 'strip=<n>', or something else) that
> we would decide to use for the regression fix anyway.

That should be fine, there are still changes to be done there so I'll rebase on this and send that series.

-- 
Regards,
Karthik Nayak
Previous: Junio C Hamano
Message 19 of 19 in “Regression? Ambiguous tags listed as "tags/<foo>"”
  1. Pete HarlanJan 23, 2016
  2. tag: do not show ambiguous tag names as "tags/foo"Jeff King, Jan 24, 2016
  3. Jeff KingJan 24, 2016
  4. Junio C HamanoJan 24, 2016
  5. Jeff KingJan 24, 2016
  6. Eric SunshineJan 24, 2016
  7. Jeff KingJan 25, 2016
  8. Junio C HamanoJan 25, 2016
  9. Jeff KingJan 25, 2016
  10. Karthik NayakJan 25, 2016
  11. Junio C HamanoJan 25, 2016
  12. Jeff KingJan 26, 2016
  13. Jeff KingJan 26, 2016
  14. Junio C HamanoJan 26, 2016
  15. Jeff KingJan 24, 2016
  16. 1/2 t6300: use test_atom for some un-modern testsJeff King, Jan 24, 2016
  17. 2/2 tag: do not show ambiguous tag names as "tags/foo"Jeff King, Jan 24, 2016
  18. Junio C HamanoJan 26, 2016
  19. Karthik NayakJan 26, 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.