git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] git grep: Add "-z/--null" option as in GNU's grep.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 1, 2008, 16:17 UTC
Message-ID
<20081001161705.GH21310@spearce.org>
In-Reply-To
<1222877475-2699-1-git-send-email-killekulla@rdrz.de>
Raphael Zimmerer <killekulla@rdrz.de> wrote:
Show 11 quoted lines
> diff --git a/builtin-grep.c b/builtin-grep.c
> index 3a51662..2241324 100644
> --- a/builtin-grep.c
> +++ b/builtin-grep.c
> @@ -295,6 +295,9 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
>  		push_arg("-l");
>  	if (opt->unmatch_name_only)
>  		push_arg("-L");
> +	if (opt->null_following_name)
> +		// in GNU grep git's "-z" translates to "-Z"
> +		push_arg("-Z");

We use /* */ style comments in Git. I've amended the patch with the simple // -> /* */ translation.

The rest of this change looks good to me.  Its queued for next.
-- 
Shawn.
Previous: Raphael Zimmerer
Message 11 of 11 in “git grep: Add "-Z/--null" option as in GNU's grep.”
  1. git grep: Add "-Z/--null" option as in GNU's grep.Raphael Zimmerer, Sep 30, 2008
  2. Shawn O. PearceSep 30, 2008
  3. Raphael ZimmererSep 30, 2008
  4. Johannes SchindelinOct 1, 2008
  5. Raphael ZimmererOct 1, 2008
  6. Shawn O. PearceOct 1, 2008
  7. Raphael ZimmererOct 1, 2008
  8. Pierre HabouzitOct 1, 2008
  9. Shawn O. PearceOct 1, 2008
  10. git grep: Add "-z/--null" option as in GNU's grep.Raphael Zimmerer, Oct 1, 2008
  11. Shawn O. PearceOct 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.