git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: merlyn@stonehenge.com (Randal L. Schwartz)
Cc: Linus Torvalds <torvalds@osdl.org>, git@vger.kernel.org
Subject: Re: file rename causes history to disappear
Date: Wed, 06 Sep 2006 17:52:54 -0700	[thread overview]
Message-ID: <7vbqps5wgp.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <86bqpsvfd3.fsf@blue.stonehenge.com> (Randal L. Schwartz's message of "06 Sep 2006 14:45:28 -0700")

merlyn@stonehenge.com (Randal L. Schwartz) writes:

>>>>>> "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

  reply	other threads:[~2006-09-07  0:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06 14:52 file rename causes history to disappear Jeff Garzik
2006-09-06 15:05 ` Timo Hirvonen
2006-09-06 15:38 ` Linus Torvalds
2006-09-06 15:46   ` Jeff Garzik
2006-09-06 16:14     ` Linus Torvalds
2006-09-06 16:37       ` Linus Torvalds
2006-09-06 19:29         ` Junio C Hamano
2006-09-06 21:45           ` Randal L. Schwartz
2006-09-07  0:52             ` Junio C Hamano [this message]
2006-09-07 10:16           ` Alex Riesen
2006-09-06 17:11       ` Jakub Narebski
2006-09-06 18:34         ` Linus Torvalds
2006-09-06 18:52           ` Jakub Narebski
2006-09-06 19:06             ` Linus Torvalds
2006-09-06 23:54               ` Junio C Hamano
2006-09-06 19:25             ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vbqps5wgp.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=merlyn@stonehenge.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).