author | Linus Torvalds <torvalds@osdl.org> | |
Mon, 12 Sep 2005 23:46:53 +0000 (16:46 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 13 Sep 2005 02:15:02 +0000 (19:15 -0700) | ||
commit | 5d9d831a51dc7847ad40fac77f9a072aa2d1c0bd | |
tree | f40840571e7188f736e4e724a0e0b49f7e51a2af | tree | snapshot |
parent | 4e48fe3f1c42519f1aad92176489eeb174a319c0 | commit | diff |
Improve "git grep" flags handling
This allows any arbitrary flags to "grep", and knows about the few
special grep flags that take an argument too.
It also allows some flags for git-ls-files, although their usefulness
is questionable.
With this, something line
git grep -w -1 pattern
works, without the script enumerating every possible flag.
[jc: this is the version Linus sent out after I showed him a
barf-o-meter test version that avoids shell arrays. He must
have typed this version blindly, since he said:
I'm not barfing, but that's probably because my brain just shut
down and is desperately trying to gouge my eyes out with a spoon.
I slightly fixed it to catch the remaining arguments meant to be
given git-ls-files.]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This allows any arbitrary flags to "grep", and knows about the few
special grep flags that take an argument too.
It also allows some flags for git-ls-files, although their usefulness
is questionable.
With this, something line
git grep -w -1 pattern
works, without the script enumerating every possible flag.
[jc: this is the version Linus sent out after I showed him a
barf-o-meter test version that avoids shell arrays. He must
have typed this version blindly, since he said:
I'm not barfing, but that's probably because my brain just shut
down and is desperately trying to gouge my eyes out with a spoon.
I slightly fixed it to catch the remaining arguments meant to be
given git-ls-files.]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-grep.sh | diff | blob | history |