Thread (12 messages) flat view 12 messages, 4 authors, 2016-06-15

Re: git show doesn't work on file names with square brackets

From: Duy Nguyen <hidden>
Date: 2016-06-15 23:08:09

On Sun, Feb 7, 2016 at 10:11 PM, Kirill Likhodedov
[off-list ref] wrote:
Hi Duy,
quoted
It's from 28fcc0b (pathspec: avoid the need of "--" when wildcard is
used - 2015-05-02)
v2.5.0 is the first release which contains 28fcc0b.
I can confirm that older versions of Git work correctly without “--“:

# /opt/local/bin/git version
git version 1.7.1.1
# /opt/local/bin/git show HEAD:bra[ckets].txt
asd

Looks like a regression?
No it's a deliberate trade-off. With that change, you can use
wildcards in pathspec without "--" (e.g. "git log 'a*'" instead of
"git log -- 'a*'"). And I still believe that happens a lot more often
than this case. Putting "--" is _the_ way to avoid ambiguation when
git fails to do it properly. Though in future we may make git smarter
at solving ambiguation (e.g. it could do glob() to test if a wildcard
pattern matches any path).
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help