All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, Pete Harlan <pgit@tento.net>,
	Karthik Nayak <karthik.188@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH] tag: do not show ambiguous tag names as "tags/foo"
Date: Sun, 24 Jan 2016 18:39:05 -0500	[thread overview]
Message-ID: <CAPig+cTq0j0ss=qw9Dx8-PqFA5WJwP0mpvoO+5=NXtOt2EUNww@mail.gmail.com> (raw)
In-Reply-To: <20160124222736.GA29115@sigill.intra.peff.net>

On Sun, Jan 24, 2016 at 5:27 PM, Jeff King <peff@peff.net> wrote:
> On Sun, Jan 24, 2016 at 02:19:52PM -0800, Junio C Hamano wrote:
>> Perhaps strip=2 can be defined to "strip 2 levels of
>> hierarchy prefix no matter what that is", and strip refs/tags/foo,
>> refs/heads/foo and refs/remotes/origin/foo to foo, foo, origin/foo,
>> respectively?  The filtering natively done by the listing mode of
>> "branch" and "tags" would ensure the prefixes are always what we
>> implicitly expect, so the case we need to worry about how we should
>> signal errors becomes "what if there are not enough levels".  That
>> may be simpler to handle.
>
> Yeah, "strip=2" would also get the job done, and extends more naturally
> to the branch case.
>
> To be honest, I cannot imagine anybody using anything _but_ strip=2, but
> maybe there are special cases, like:
>
>   git for-each-ref --format='%(refname:strip=3)' refs/heads/jk/
>
> to get my list of topics, sans initials.

What if the option was named ":stripprefix=" in its most general form:

    %(refname:stripprefix=refs/tags/)

with plain:

    %(refname:stripprefix)

shorthand for ":stripprefix=refs/*/" or something?

  reply	other threads:[~2016-01-24 23:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23 23:56 Regression? Ambiguous tags listed as "tags/<foo>" Pete Harlan
2016-01-24  7:12 ` [PATCH] tag: do not show ambiguous tag names as "tags/foo" Jeff King
2016-01-24  7:18   ` Jeff King
2016-01-24 22:19     ` Junio C Hamano
2016-01-24 22:27       ` Jeff King
2016-01-24 23:39         ` Eric Sunshine [this message]
2016-01-25  9:56           ` Jeff King
2016-01-25  2:26         ` Junio C Hamano
2016-01-25 10:01           ` Jeff King
2016-01-25 19:29             ` Karthik Nayak
2016-01-25 20:21             ` Junio C Hamano
2016-01-26  2:37               ` Jeff King
2016-01-26  3:00                 ` Jeff King
2016-01-26  3:25                 ` Junio C Hamano
2016-01-24 23:05       ` Jeff King
2016-01-24 23:08         ` [PATCH 1/2] t6300: use test_atom for some un-modern tests Jeff King
2016-01-24 23:08         ` [PATCH 2/2] tag: do not show ambiguous tag names as "tags/foo" Jeff King
2016-01-26  0:04           ` Junio C Hamano
2016-01-26  4:25             ` Karthik Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPig+cTq0j0ss=qw9Dx8-PqFA5WJwP0mpvoO+5=NXtOt2EUNww@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --cc=peff@peff.net \
    --cc=pgit@tento.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.