Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC] Making ce_path_match() more useful by accepting globs

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:53

Junio C Hamano [off-list ref] writes:
Alex Riesen [off-list ref] writes:
quoted
Junio C Hamano, Sun, Nov 25, 2007 19:03:12 +0100:
quoted
Currently ce_path_match() only uses "the leading directory" match, and
does not understand file globs.  These do not work:

   git diff-files 't/*.sh'
   git diff-index HEAD 'xdiff/*.c'
   git update-index -g 'Documentation/howto/*.txt'
How should my scripts handle files with "*" in names?
...
Having said that, I would think that quoting the meta from fnmatch(3)
like this:

	git ls-files 'such-\*-a-file'

would work fine, just like

	ls such-\*-a-file

would.
Yup.  I just did:

	$ >M\*kefile
        $ git add 'M\*kefile'
        $ git ls-files 'M\*kefile'
        M*kefile
        $ git ls-files 'M*kefile'
        M*kefile
        Makefile
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help