Re: file rename causes history to disappear

From: Junio C Hamano <>
Date: 2006-09-07 10:52:54 (Randal L. Schwartz) writes:

>>>>>> "Junio" == Junio C Hamano <> 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

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at
Received on Thu Sep 07 10:53:21 2006

This archive was generated by hypermail 2.1.8 : 2006-09-07 10:53:56 EST