git grep: Add "-z/--null" option as in GNU's grep.

Here's a trivial patch that adds "-z" and "--null" options to "git
grep". It was discussed on the mailing-list that git's "-z"
convention should be used instead of GNU grep's "-Z".
So things like 'git grep -l -z "$FOO" | xargs -0 sed -i "s/$FOO/$BOO/"'
do work now.

Signed-off-by: Raphael Zimmerer <killekulla@rdrz.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Raphael Zimmerer
2008-10-01 18:11:15 +02:00
committed by Shawn O. Pearce
parent 5e22e21769
commit 83caecca2f
4 changed files with 26 additions and 3 deletions

1
grep.h
View File

@ -74,6 +74,7 @@ struct grep_opt {
unsigned extended:1;
unsigned relative:1;
unsigned pathname:1;
unsigned null_following_name:1;
int regflags;
unsigned pre_context;
unsigned post_context;