git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [RFC/PATCH] recognize pathspec magic without "--" disambiguation
Date: Sun, 28 May 2017 09:04:06 +0900	[thread overview]
Message-ID: <xmqqd1atc0eh.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170527203937.hto7lwxfbjvl5f7o@sigill.intra.peff.net> (Jeff King's message of "Sat, 27 May 2017 16:39:38 -0400")

Jeff King <peff@peff.net> writes:

> Yeah. That's a good reason not to use ":/" without a disambiguating "--"
> (which _does_ work, even without my series, because check_filename()
> does specific path-matching). At best, you pay for a complete useless
> history traversal before the command actually starts running. But much
> more likely is that Git just complains of ambiguity, because people tend
> to mention top-level paths in their commit messages. E.g.:
>
>   $ cd t
>   $ git grep foo :/Documentation
>   fatal: ambiguous argument ':/Documentation': both revision and filename
>
> So it really is a pretty horrible syntax.

It does not allow it to be further annotated like "HEAD^{/^Merge
branch 'foo'}^2".  Yes, I agree that ":/string" was a pretty poor
design that was done without thinking things through.

But back then in 2007, it is a bit unfair to blame the initial
design for not thinking things through.  There weren't as many
precedents, good or bad, to learn from than we have today ;-)


      reply	other threads:[~2017-05-28  0:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 15:27 [RFC/PATCH] recognize pathspec magic without "--" disambiguation Jeff King
2017-05-26  2:13 ` Junio C Hamano
2017-05-26 13:24   ` Jeff King
2017-05-26 19:06     ` [PATCH 0/6] make "^:foo" work without disambiguating "--" Jeff King
2017-05-26 19:06       ` [PATCH 1/6] t4208: add check for ":/" without matching file Jeff King
2017-05-26 19:07       ` [PATCH 2/6] check_filename(): refactor ":/" handling Jeff King
2017-05-26 19:07       ` [PATCH 3/6] check_filename(): use skip_prefix Jeff King
2017-05-26 19:08       ` [PATCH 4/6] check_filename(): handle ":^" path magic Jeff King
2017-05-26 19:10       ` [PATCH 5/6] verify_filename(): treat ":(magic)" as a pathspec Jeff King
2017-05-26 19:10       ` [PATCH 6/6] verify_filename(): flip order of checks Jeff King
2017-05-27  9:54 ` [RFC/PATCH] recognize pathspec magic without "--" disambiguation Ævar Arnfjörð Bjarmason
2017-05-27 20:39   ` Jeff King
2017-05-28  0:04     ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqd1atc0eh.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).