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
Santiago Torres <santiago@nyu.edu>
Date
Oct 19, 2016, 17:07 UTC
Message-ID
<20161019170733.ey3d53miykn5t5cq@LykOS.localdomain>
In-Reply-To
<20161019091641.vcv3snlg5xr3yazs@sigill.intra.peff.net>
On Wed, Oct 19, 2016 at 05:16:42AM -0400, Jeff King wrote:
Show 25 quoted lines
> On Wed, Oct 19, 2016 at 04:55:43AM -0400, Jeff King wrote:
> 
> > > diff --git a/ref-filter.h b/ref-filter.h
> > > index 14d435e..3d23090 100644
> > > --- a/ref-filter.h
> > > +++ b/ref-filter.h
> > > @@ -107,4 +107,7 @@ struct ref_sorting *ref_default_sorting(void);
> > >  /*  Function to parse --merged and --no-merged options */
> > >  int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
> > >  
> > > +void pretty_print_ref(const char *name, const unsigned char *sha1,
> > > +		const char *format, unsigned kind);
> > > +
> > 
> > What are the possible values for "kind"? I guess these should come from
> > FILTER_REFS_TAGS, BRANCHES, etc. It's probably worth documenting that.
> > Alternatively, is it possible to just determine this from the name? It
> > looks like filter_ref_kind() is how it happens for a normal ref-filter.
> 
> 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.

Thanks, -Santiago.

Previous: Jeff KingNext: santiago@nyu.edu
Message 5 of 16 in “Add --format to tag verification”
  1. 0/7 Add --format to tag verificationsantiago@nyu.edu, Oct 7, 2016
  2. 2/7 ref-filter: add function to print single ref_array_itemsantiago@nyu.edu, Oct 7, 2016
  3. Jeff KingOct 19, 2016
  4. Jeff KingOct 19, 2016
  5. Santiago TorresOct 19, 2016
  6. 4/7 builtin/verify-tag: add --format to verify-tagsantiago@nyu.edu, Oct 7, 2016
  7. Jeff KingOct 19, 2016
  8. 3/7 tag: add format specifier to gpg_verify_tagsantiago@nyu.edu, Oct 7, 2016
  9. 1/7 gpg-interface, tag: add GPG_VERIFY_QUIET flagsantiago@nyu.edu, Oct 7, 2016
  10. Jeff KingOct 19, 2016
  11. 5/7 builtin/tag: add --format argument for tag -vsantiago@nyu.edu, Oct 7, 2016
  12. Jeff KingOct 19, 2016
  13. 6/7 t/t7030-verify-tag: Add --format specifier testssantiago@nyu.edu, Oct 7, 2016
  14. Jeff KingOct 19, 2016
  15. 7/7 t/t7004-tag: Add --format specifier testssantiago@nyu.edu, Oct 7, 2016
  16. Santiago TorresOct 11, 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.