Re: file rename causes history to disappear
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:39
merlyn@stonehenge.com (Randal L. Schwartz) writes:
quoted
quoted
quoted
quoted
quoted
"Junio" == Junio C Hamano [off-list ref] writes:Junio> The only people who will get burnt by this change are the ones Junio> with metacharacters in their pathnames, so it is relative safe Junio> change. But does that mean you'll provide the equivalent to "fgrep" for "grep", as in a switch that turns this off, or a seperate command? I can think of times when I might be trying to track a file with a square bracket in the name.
If your path is "foo.c[1]" then "foo.c[1]" as fnmatch() pattern would not obviously match it, which is sad. However, we do try to match the path literally before falling back to fnmatch() so in practice I do not think it is so bad. $ git ls-files -s ;# everybody has "hello world". 100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 foo.c 100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 foo/bar[1]/baz/boa.c 100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 foo/bar[2].c $ git grep hello -- 'foo/bar[1]' foo/bar[1]/baz/boa.c:hello world $ git grep hello -- 'foo/bar[[]*[]]*' foo/bar[1]/baz/boa.c:hello world foo/bar[2].c:hello world $ git grep hello -- 'fo*' foo.c:hello world foo/bar[1]/baz/boa.c:hello world foo/bar[2].c:hello world $ exit