git-annex/doc/bugs/unexpected_double_wildcard_expansion.mdwn
Joey Hess f35d0bf4b2 Prevent git-ls-files from double-expanding wildcards when an unexpanded wildcard is passed to a git-annex command like add or find.
Note that previously, `git annex find *.jpg` would find eg, foo/bar.jpg.
That was never intended or documented behavior, so I'm going to change it.
But this is potentially a behavior change if someone discovered that
behavior and relied on it despite it being accidental. Oh well.. can't make
an omlette w/o breaking some eggs.
2015-03-27 16:45:50 -04:00

15 lines
661 B
Markdown

From the forum, it seems that git-ls-files very unexpectedly expands
wildcards in filenames passed to it. (Not a documented or an expected
behavior.)
This causes problems when eg, the user does `git annex add *.jpeg` and that
matches no files, but there are some jpegs in subdirectories. git-ls-files
re-expands the wildcard and finds those.
Seems that the best fix is to make Git.LsFiles paper over this git
misfeature, by always escaping wildcards in paths passed
to git-ls-files. AFAIK, no callers of Git.LsFiles expect to provide it
wildcards, because I was completely surprised when I learned they were
expanded.. --[[Joey]]
> [[fixed|done]] --[[Joey]]