Skip to content
Snippets Groups Projects
Commit 5d9d831a authored by Linus Torvalds's avatar Linus Torvalds Committed by Junio C Hamano
Browse files

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: default avatarLinus Torvalds <torvalds@osdl.org>
Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
parent 4e48fe3f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment