{"thread":{"id":"15733","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","startedAt":"2008-09-30T23:13:10Z","lastAt":"2008-10-01T16:17:05Z","messageCount":11,"participants":["Shawn O. Pearce","Raphael Zimmerer","Pierre Habouzit","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"91995","messageId":"1222816390-9141-1-git-send-email-killekulla@rdrz.de","threadId":"15733","inReplyTo":null,"subject":"[PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Raphael Zimmerer","fromEmail":"killekulla@rdrz.de","sentAt":"2008-09-30T23:13:10Z","receivedAt":"2008-09-30T23:13:10Z","isPatch":true,"sender":{"key":"killekulla@rdrz.de","avatar":"https://avatars.githubusercontent.com/u/35472983?v=4"},"body":"Here's a trivial patch that adds \"-Z\" and \"--null\" options to \"git\ngrep\" equal to GNU's grep.\nSo things like 'git grep -l -Z \"$FOO\" | xargs -0 sed -i \"s/$FOO/$BOO/\"'\nare more comfortable.\n\nSigned-off-by: Raphael Zimmerer <killekulla@rdrz.de>\n---\n Documentation/git-grep.txt |    6 ++++++\n builtin-grep.c             |    7 +++++++\n grep.c                     |   14 +++++++++++---\n grep.h                     |    1 +\n 4 files changed, 25 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex fa4d133..9317377 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -15,6 +15,7 @@ SYNOPSIS\n \t   [-E | --extended-regexp] [-G | --basic-regexp]\n \t   [-F | --fixed-strings] [-n]\n \t   [-l | --files-with-matches] [-L | --files-without-match]\n+\t   [-Z | --null]\n \t   [-c | --count] [--all-match]\n \t   [-A <post-context>] [-B <pre-context>] [-C <context>]\n \t   [-f <file>] [-e] <pattern>\n@@ -94,6 +95,11 @@ OPTIONS\n \tFor better compatibility with 'git-diff', --name-only is a\n \tsynonym for --files-with-matches.\n \n+-Z::\n+--null::\n+\tOutput \\0 instead of the character that normally follows a\n+\tfile name.\n+\n -c::\n --count::\n \tInstead of showing every matched line, show the number of\ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 3a51662..fb2abe4 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -295,6 +295,8 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)\n \t\tpush_arg(\"-l\");\n \tif (opt->unmatch_name_only)\n \t\tpush_arg(\"-L\");\n+\tif (opt->null_following_name)\n+\t\tpush_arg(\"-Z\");\n \tif (opt->count)\n \t\tpush_arg(\"-c\");\n \tif (opt->post_context || opt->pre_context) {\n@@ -599,6 +601,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t\topt.unmatch_name_only = 1;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(\"-Z\", arg) ||\n+\t\t    !strcmp(\"--null\", arg)) {\n+\t\t\topt.null_following_name = 1;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(\"-c\", arg) ||\n \t\t    !strcmp(\"--count\", arg)) {\n \t\t\topt.count = 1;\ndiff --git a/grep.c b/grep.c\nindex 7063511..2619dbf 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -239,6 +239,8 @@ static int word_char(char ch)\n static void show_line(struct grep_opt *opt, const char *bol, const char *eol,\n \t\t      const char *name, unsigned lno, char sign)\n {\n+\tif (opt->null_following_name)\n+\t\tsign = 0;\n \tif (opt->pathname)\n \t\tprintf(\"%s%c\", name, sign);\n \tif (opt->linenum)\n@@ -246,6 +248,11 @@ static void show_line(struct grep_opt *opt, const char *bol, const char *eol,\n \tprintf(\"%.*s\\n\", (int)(eol-bol), bol);\n }\n \n+static void show_name(struct grep_opt *opt, const char *name)\n+{\n+\tprintf(\"%s%c\", name, opt->null_following_name ? 0 : '\\n');\n+}\n+\n static int fixmatch(const char *pattern, char *line, regmatch_t *match)\n {\n \tchar *hit = strstr(line, pattern);\n@@ -489,7 +496,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t\t\t\treturn 1;\n \t\t\t}\n \t\t\tif (opt->name_only) {\n-\t\t\t\tprintf(\"%s\\n\", name);\n+\t\t\t\tshow_name(opt, name);\n \t\t\t\treturn 1;\n \t\t\t}\n \t\t\t/* Hit at this line.  If we haven't shown the\n@@ -555,7 +562,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t\treturn 0;\n \tif (opt->unmatch_name_only) {\n \t\t/* We did not see any hit, so we want to show this */\n-\t\tprintf(\"%s\\n\", name);\n+\t\tshow_name(opt, name);\n \t\treturn 1;\n \t}\n \n@@ -565,7 +572,8 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t * make it another option?  For now suppress them.\n \t */\n \tif (opt->count && count)\n-\t\tprintf(\"%s:%u\\n\", name, count);\n+\t\tprintf(\"%s%c%u\\n\", name,\n+\t\t       opt->null_following_name ? 0 : ':', count);\n \treturn !!last_hit;\n }\n \ndiff --git a/grep.h b/grep.h\nindex 59b3f87..45a222d 100644\n--- a/grep.h\n+++ b/grep.h\n@@ -74,6 +74,7 @@ struct grep_opt {\n \tunsigned extended:1;\n \tunsigned relative:1;\n \tunsigned pathname:1;\n+\tunsigned null_following_name:1;\n \tint regflags;\n \tunsigned pre_context;\n \tunsigned post_context;\n-- \n1.5.6.3\n"},{"id":"91994","messageId":"20080930231619.GR21310@spearce.org","threadId":"15733","inReplyTo":"1222816390-9141-1-git-send-email-killekulla@rdrz.de","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-09-30T23:16:19Z","receivedAt":"2008-09-30T23:16:19Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Raphael Zimmerer <killekulla@rdrz.de> wrote:\n> Here's a trivial patch that adds \"-Z\" and \"--null\" options to \"git\n> grep\" equal to GNU's grep.\n> So things like 'git grep -l -Z \"$FOO\" | xargs -0 sed -i \"s/$FOO/$BOO/\"'\n> are more comfortable.\n\nElsewhere in Git we call this \"-z\", like \"git ls-tree -z\", \"git\nlog -z\".  Should we match grep or git convention here?\n \n>  Documentation/git-grep.txt |    6 ++++++\n>  builtin-grep.c             |    7 +++++++\n>  grep.c                     |   14 +++++++++++---\n>  grep.h                     |    1 +\n\n-- \nShawn.\n"},{"id":"91997","messageId":"20080930234157.GA1453@rdrz.de","threadId":"15733","inReplyTo":"20080930231619.GR21310@spearce.org","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Raphael Zimmerer","fromEmail":"killekulla@rdrz.de","sentAt":"2008-09-30T23:41:57Z","receivedAt":"2008-09-30T23:41:57Z","isPatch":true,"sender":{"key":"killekulla@rdrz.de","avatar":"https://avatars.githubusercontent.com/u/35472983?v=4"},"body":"On Tue, Sep 30, 2008 at 04:16:19PM -0700, Shawn O. Pearce wrote:\n> Elsewhere in Git we call this \"-z\", like \"git ls-tree -z\", \"git\n> log -z\".  Should we match grep or git convention here?\n\nI'd tend to grep's convention, as most options of git-grep mimic those\nof grep. grep uses \"-z\" for \\0 on _input_, so that would be very\nconfusing for grep users...\n\n- Raphael\n"},{"id":"92033","messageId":"20081001061249.GC22363@artemis.corp","threadId":"15733","inReplyTo":"1222816390-9141-1-git-send-email-killekulla@rdrz.de","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-01T06:12:49Z","receivedAt":"2008-10-01T06:12:49Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Tue, Sep 30, 2008 at 11:13:10PM +0000, Raphael Zimmerer wrote:\n> +\tprintf(\"%s%c\", name, opt->null_following_name ? 0 : '\\n');\n\nI know I'm nitpicking and I don't know what the git custom on this\nreally is, but I tend to prefer '\\0' when in the context of a char.\nThere is no confusion here of course, but I believe it to be a sane\nhabit. (In the same vein that it's ugly to use 0 for NULL ;p).\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"92047","messageId":"alpine.DEB.1.00.0810011514530.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"15733","inReplyTo":"20080930234157.GA1453@rdrz.de","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-01T13:15:34Z","receivedAt":"2008-10-01T13:15:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 1 Oct 2008, Raphael Zimmerer wrote:\n\n> On Tue, Sep 30, 2008 at 04:16:19PM -0700, Shawn O. Pearce wrote:\n> > Elsewhere in Git we call this \"-z\", like \"git ls-tree -z\", \"git log \n> > -z\".  Should we match grep or git convention here?\n> \n> I'd tend to grep's convention, as most options of git-grep mimic those \n> of grep. grep uses \"-z\" for \\0 on _input_, so that would be very \n> confusing for grep users...\n\nI tend to disagree.  Git is _already_ perceived as too heterogenous, and \nwe should not add to that pile.\n\nCiao,\nDscho\n"},{"id":"92048","messageId":"20081001132351.GA20659@rdrz.de","threadId":"15733","inReplyTo":"alpine.DEB.1.00.0810011514530.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Raphael Zimmerer","fromEmail":"killekulla@rdrz.de","sentAt":"2008-10-01T13:23:51Z","receivedAt":"2008-10-01T13:23:51Z","isPatch":true,"sender":{"key":"killekulla@rdrz.de","avatar":"https://avatars.githubusercontent.com/u/35472983?v=4"},"body":"On Wed, Oct 01, 2008 at 03:15:34PM +0200, Johannes Schindelin wrote:\n> On Wed, 1 Oct 2008, Raphael Zimmerer wrote:\n> > On Tue, Sep 30, 2008 at 04:16:19PM -0700, Shawn O. Pearce wrote:\n> > > Elsewhere in Git we call this \"-z\", like \"git ls-tree -z\", \"git log \n> > > -z\".  Should we match grep or git convention here?\n> > \n> > I'd tend to grep's convention, as most options of git-grep mimic those \n> > of grep. grep uses \"-z\" for \\0 on _input_, so that would be very \n> > confusing for grep users...\n> \n> I tend to disagree.  Git is _already_ perceived as too heterogenous, and \n> we should not add to that pile.\n\nHow about discarding \"-Z\" from my patch, and only leave in \"--null\"?\nThat removes ambiguity _and_ is compatible to GNU grep.\n\n- Raphael\n"},{"id":"92053","messageId":"20081001145207.GW21310@spearce.org","threadId":"15733","inReplyTo":"alpine.DEB.1.00.0810011514530.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-01T14:52:07Z","receivedAt":"2008-10-01T14:52:07Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> On Wed, 1 Oct 2008, Raphael Zimmerer wrote:\n> \n> > On Tue, Sep 30, 2008 at 04:16:19PM -0700, Shawn O. Pearce wrote:\n> > > Elsewhere in Git we call this \"-z\", like \"git ls-tree -z\", \"git log \n> > > -z\".  Should we match grep or git convention here?\n> > \n> > I'd tend to grep's convention, as most options of git-grep mimic those \n> > of grep. grep uses \"-z\" for \\0 on _input_, so that would be very \n> > confusing for grep users...\n> \n> I tend to disagree.  Git is _already_ perceived as too heterogenous, and \n> we should not add to that pile.\n\nI already have my brain wired that \"\\0 terminators in Git are -z\".\nThus I'd assume \"git grep -z  .. | xargs -0\" would work.  Today it\ndoesn't without this patch, but if the patch was added I'd assume\nit would work.\n\nPerhaps I'm too close to git as a contributor and experienced user\nto realize any brain damage.\n\nI'd rather stick to \"-z\" in Git.  At least its consistent.\n\nIts not like tools outside of Git are all that consistent.  GNU\ngrep uses --null/-Z.  xargs and perl use -0.  find uses -print0.\nThe human at the keyboard already has to navigate this rats nest\nbetween different tools, but within a tool (git) we should be as\nconsistent as we can.\n\n-- \nShawn.\n"},{"id":"92057","messageId":"20081001150308.GZ21310@spearce.org","threadId":"15733","inReplyTo":"20081001061249.GC22363@artemis.corp","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-01T15:03:08Z","receivedAt":"2008-10-01T15:03:08Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> wrote:\n> On Tue, Sep 30, 2008 at 11:13:10PM +0000, Raphael Zimmerer wrote:\n> > +\tprintf(\"%s%c\", name, opt->null_following_name ? 0 : '\\n');\n> \n> I know I'm nitpicking and I don't know what the git custom on this\n> really is, but I tend to prefer '\\0' when in the context of a char.\n> There is no confusion here of course, but I believe it to be a sane\n> habit. (In the same vein that it's ugly to use 0 for NULL ;p).\n\nIts a valid nitpick.  NUL is '\\0' when dealing with chars in Git,\nNULL is NULL, and 0 is the integer 0.  That line should read '\\0'\nto conform with the other code already in git.git.\n\n-- \nShawn.\n"},{"id":"92059","messageId":"20081001151114.GB20659@rdrz.de","threadId":"15733","inReplyTo":"20081001145207.GW21310@spearce.org","subject":"Re: [PATCH] git grep: Add \"-Z/--null\" option as in GNU's grep.","fromName":"Raphael Zimmerer","fromEmail":"killekulla@rdrz.de","sentAt":"2008-10-01T15:11:14Z","receivedAt":"2008-10-01T15:11:14Z","isPatch":true,"sender":{"key":"killekulla@rdrz.de","avatar":"https://avatars.githubusercontent.com/u/35472983?v=4"},"body":"On Wed, Oct 01, 2008 at 07:52:07AM -0700, Shawn O. Pearce wrote:\n> Its not like tools outside of Git are all that consistent.  GNU\n> grep uses --null/-Z.  xargs and perl use -0.  find uses -print0.\n> The human at the keyboard already has to navigate this rats nest\n> between different tools, but within a tool (git) we should be as\n> consistent as we can.\n\n... and git-config uses --null/-z.\n\nI will send an updated patch with --null/-z.\n\n- Raphael\n"},{"id":"92072","messageId":"1222877475-2699-1-git-send-email-killekulla@rdrz.de","threadId":"15733","inReplyTo":"1222816390-9141-1-git-send-email-killekulla@rdrz.de","subject":"[PATCH v2] git grep: Add \"-z/--null\" option as in GNU's grep.","fromName":"Raphael Zimmerer","fromEmail":"killekulla@rdrz.de","sentAt":"2008-10-01T16:11:15Z","receivedAt":"2008-10-01T16:11:15Z","isPatch":true,"sender":{"key":"killekulla@rdrz.de","avatar":"https://avatars.githubusercontent.com/u/35472983?v=4"},"body":"Here's a trivial patch that adds \"-z\" and \"--null\" options to \"git\ngrep\". It was discussed on the mailing-list that git's \"-z\"\nconvention should be used instead of GNU grep's \"-Z\".\nSo things like 'git grep -l -z \"$FOO\" | xargs -0 sed -i \"s/$FOO/$BOO/\"'\ndo work now.\n\nSigned-off-by: Raphael Zimmerer <killekulla@rdrz.de>\n---\n\nChanges from first patch:\n    * \"-Z\" -> \"-z\"\n    * use '\\0' instead of 0\nRegards\n  Raphael\n\n Documentation/git-grep.txt |    6 ++++++\n builtin-grep.c             |    8 ++++++++\n grep.c                     |   14 +++++++++++---\n grep.h                     |    1 +\n 4 files changed, 26 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex fa4d133..553da6c 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -15,6 +15,7 @@ SYNOPSIS\n \t   [-E | --extended-regexp] [-G | --basic-regexp]\n \t   [-F | --fixed-strings] [-n]\n \t   [-l | --files-with-matches] [-L | --files-without-match]\n+\t   [-z | --null]\n \t   [-c | --count] [--all-match]\n \t   [-A <post-context>] [-B <pre-context>] [-C <context>]\n \t   [-f <file>] [-e] <pattern>\n@@ -94,6 +95,11 @@ OPTIONS\n \tFor better compatibility with 'git-diff', --name-only is a\n \tsynonym for --files-with-matches.\n \n+-z::\n+--null::\n+\tOutput \\0 instead of the character that normally follows a\n+\tfile name.\n+\n -c::\n --count::\n \tInstead of showing every matched line, show the number of\ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 3a51662..2241324 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -295,6 +295,9 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)\n \t\tpush_arg(\"-l\");\n \tif (opt->unmatch_name_only)\n \t\tpush_arg(\"-L\");\n+\tif (opt->null_following_name)\n+\t\t// in GNU grep git's \"-z\" translates to \"-Z\"\n+\t\tpush_arg(\"-Z\");\n \tif (opt->count)\n \t\tpush_arg(\"-c\");\n \tif (opt->post_context || opt->pre_context) {\n@@ -599,6 +602,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t\topt.unmatch_name_only = 1;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(\"-z\", arg) ||\n+\t\t    !strcmp(\"--null\", arg)) {\n+\t\t\topt.null_following_name = 1;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(\"-c\", arg) ||\n \t\t    !strcmp(\"--count\", arg)) {\n \t\t\topt.count = 1;\ndiff --git a/grep.c b/grep.c\nindex 7063511..e2c190a 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -239,6 +239,8 @@ static int word_char(char ch)\n static void show_line(struct grep_opt *opt, const char *bol, const char *eol,\n \t\t      const char *name, unsigned lno, char sign)\n {\n+\tif (opt->null_following_name)\n+\t\tsign = '\\0';\n \tif (opt->pathname)\n \t\tprintf(\"%s%c\", name, sign);\n \tif (opt->linenum)\n@@ -246,6 +248,11 @@ static void show_line(struct grep_opt *opt, const char *bol, const char *eol,\n \tprintf(\"%.*s\\n\", (int)(eol-bol), bol);\n }\n \n+static void show_name(struct grep_opt *opt, const char *name)\n+{\n+\tprintf(\"%s%c\", name, opt->null_following_name ? '\\0' : '\\n');\n+}\n+\n static int fixmatch(const char *pattern, char *line, regmatch_t *match)\n {\n \tchar *hit = strstr(line, pattern);\n@@ -489,7 +496,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t\t\t\treturn 1;\n \t\t\t}\n \t\t\tif (opt->name_only) {\n-\t\t\t\tprintf(\"%s\\n\", name);\n+\t\t\t\tshow_name(opt, name);\n \t\t\t\treturn 1;\n \t\t\t}\n \t\t\t/* Hit at this line.  If we haven't shown the\n@@ -555,7 +562,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t\treturn 0;\n \tif (opt->unmatch_name_only) {\n \t\t/* We did not see any hit, so we want to show this */\n-\t\tprintf(\"%s\\n\", name);\n+\t\tshow_name(opt, name);\n \t\treturn 1;\n \t}\n \n@@ -565,7 +572,8 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t * make it another option?  For now suppress them.\n \t */\n \tif (opt->count && count)\n-\t\tprintf(\"%s:%u\\n\", name, count);\n+\t\tprintf(\"%s%c%u\\n\", name,\n+\t\t       opt->null_following_name ? '\\0' : ':', count);\n \treturn !!last_hit;\n }\n \ndiff --git a/grep.h b/grep.h\nindex 59b3f87..45a222d 100644\n--- a/grep.h\n+++ b/grep.h\n@@ -74,6 +74,7 @@ struct grep_opt {\n \tunsigned extended:1;\n \tunsigned relative:1;\n \tunsigned pathname:1;\n+\tunsigned null_following_name:1;\n \tint regflags;\n \tunsigned pre_context;\n \tunsigned post_context;\n-- \n1.5.6.5\n"},{"id":"92073","messageId":"20081001161705.GH21310@spearce.org","threadId":"15733","inReplyTo":"1222877475-2699-1-git-send-email-killekulla@rdrz.de","subject":"Re: [PATCH v2] git grep: Add \"-z/--null\" option as in GNU's grep.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-01T16:17:05Z","receivedAt":"2008-10-01T16:17:05Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Raphael Zimmerer <killekulla@rdrz.de> wrote:\n> diff --git a/builtin-grep.c b/builtin-grep.c\n> index 3a51662..2241324 100644\n> --- a/builtin-grep.c\n> +++ b/builtin-grep.c\n> @@ -295,6 +295,9 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)\n>  \t\tpush_arg(\"-l\");\n>  \tif (opt->unmatch_name_only)\n>  \t\tpush_arg(\"-L\");\n> +\tif (opt->null_following_name)\n> +\t\t// in GNU grep git's \"-z\" translates to \"-Z\"\n> +\t\tpush_arg(\"-Z\");\n\nWe use /* */ style comments in Git.  I've amended the patch with\nthe simple // -> /* */ translation.\n\nThe rest of this change looks good to me.  Its queued for next.\n\n-- \nShawn.\n"}]}