Re: [RFC/PATCH] recognize pathspec magic without "--" disambiguation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 28, 2017, 00:04 UTC
- Message-ID
- <xmqqd1atc0eh.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170527203937.hto7lwxfbjvl5f7o@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> 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 ;-)