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

Re: [PATCH v4 2/7] ref-filter: add function to print single ref_array_item

From
Jeff King <peff@peff.net>
Date
Oct 19, 2016, 20:35 UTC
Message-ID
<20161019203520.zevkb75at2nrogdm@sigill.intra.peff.net>
In-Reply-To
<20161019170733.ey3d53miykn5t5cq@LykOS.localdomain>
On Wed, Oct 19, 2016 at 01:07:34PM -0400, Santiago Torres wrote:
Show 12 quoted lines
> > I guess that may complicate things for the caller you add in this
> > series, which may not have a fully-qualified refname (which is obviously
> > how filter_ref_kind() figures it out). I'd argue that is a bug, though,
> > as things like "%(refname)" are generally expected to print out the
> > fully refname ("git tag --format=%(refname)" does so, and you can use
> > "%(refname:short)" if you want the shorter part).
> 
> Hmm, I hadn't actually noticed that. Do you have any suggestions in how to
> address this?
> 
> In general this feels like a consequence of disambiguating .git/tags/*
> within builtin/tag.c rather than letting ref-filter figure it out.

The partial solution would look like something below. It's not too bad because git-tag always knows that it's working a ref in the refs/tags namespace (and we don't even have to qualify it ourselves, for_each_tag_name already does it for us).

But verify-tag feeds arbitrary sha1 expressions. See the notes in the second patch.

  [1/2]: ref-filter: split ref_kind_from_filter
  [2/2]: tag: send fully qualified refnames to verify_tag_and_format
 builtin/tag.c |  2 +-
 ref-filter.c  | 21 +++++++++++++--------
 ref-filter.h  |  6 +++++-
 tag.c         |  2 +-
 4 files changed, 20 insertions(+), 11 deletions(-)
-Peff
Next: Jeff King
Message 1 of 7 in “Re: [PATCH v4 2/7] ref-filter: add function to print single ref_array_item”
  1. Jeff KingOct 19, 2016
  2. 1/2 ref-filter: split ref_kind_from_filterJeff King, Oct 19, 2016
  3. Junio C HamanoOct 19, 2016
  4. Jeff KingOct 19, 2016
  5. 2/2 tag: send fully qualified refnames to verify_tag_and_formatJeff King, Oct 19, 2016
  6. Santiago TorresOct 20, 2016
  7. Jeff KingOct 20, 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.