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