git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: file rename causes history to disappear

From
Junio C Hamano <junkio@cox.net>
Date
Sep 7, 2006, 00:52 UTC
Message-ID
<7vbqps5wgp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<86bqpsvfd3.fsf@blue.stonehenge.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
Show 11 quoted lines
>>>>>> "Junio" == Junio C Hamano <junkio@cox.net> 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

Previous: Randal L. SchwartzNext: Alex Riesen
Message 9 of 16 in “file rename causes history to disappear”
  1. Jeff GarzikSep 6, 2006
  2. Timo HirvonenSep 6, 2006
  3. Linus TorvaldsSep 6, 2006
  4. Jeff GarzikSep 6, 2006
  5. Linus TorvaldsSep 6, 2006
  6. Linus TorvaldsSep 6, 2006
  7. Junio C HamanoSep 6, 2006
  8. Randal L. SchwartzSep 6, 2006
  9. Junio C HamanoSep 7, 2006
  10. Alex RiesenSep 7, 2006
  11. Jakub NarebskiSep 6, 2006
  12. Linus TorvaldsSep 6, 2006
  13. Jakub NarebskiSep 6, 2006
  14. Linus TorvaldsSep 6, 2006
  15. Junio C HamanoSep 6, 2006
  16. Jakub NarebskiSep 6, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.