git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Pete Harlan <pgit@tento.net>,
	Karthik Nayak <karthik.188@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] tag: do not show ambiguous tag names as "tags/foo"
Date: Mon, 25 Jan 2016 05:01:41 -0500	[thread overview]
Message-ID: <20160125100141.GC24452@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqsi1m9yxh.fsf@gitster.mtv.corp.google.com>

On Sun, Jan 24, 2016 at 06:26:50PM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > 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...
> 
> I 100% agree, and I do consider this to be internal implementation
> detail for the listing modes of "tag" (and "branch"), which may be
> exposed to the user (by documenting that %(refname:X) is used by
> default), so perhaps even the flexibility of strip=2 is unwanted.
> 
> I know what "remove-standard-prefix" is way too long for the value
> of X above, but then we can say "the command will error out if you
> allow your for-each-ref invocation to step outside of the area that
> has standard prefix to be removed." without having to worry about
> "what is the sensible thing to do when the prefixes are not what we
> expect (too short for strip=2 or no match for short=refs/tags/)".

I'm not sure "remove-standard-prefix" doesn't open its own questions.
Like "what are the standard prefixes?".

If we are going to go with "remove a prefix", I really don't think
"remove if present" is too complicated a set of semantics (as opposed to
"error out" you mentioned above).

I do like "strip=<n>" for its simplicity (it's easy to explain), and the
fact that it will probably handle the git-branch case for us. The only
open question is what to do if there are fewer components, but I really
think any of the 4 behaviors I gave earlier would be fine.

Eric' globbing suggestion is simpler for the error case (as a prefix, it
can be "remove if present"), but I think introducing globbing in general
opens up too many corner cases (e.g., does "*" match "/", is "**"
supported, etc).

-Peff

  reply	other threads:[~2016-01-25 10:01 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
2016-01-25  9:56           ` Jeff King
2016-01-25  2:26         ` Junio C Hamano
2016-01-25 10:01           ` Jeff King [this message]
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=20160125100141.GC24452@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).