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

Re: [PATCH] Add a -z option to 'git status' to safely feed shell programs with path names

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 17, 2008, 02:51 UTC
Message-ID
<20080517025133.GQ29038@spearce.org>
In-Reply-To
<20080517023340.GG10006@kali.thurne.chezwam.org>
Sebastien Gross <seb-git@chezwam.org> wrote:
> Add a -z option to 'git status' to get a list of all files
> but ignored, starting with modification type or 'untracked'
> as prefix and ending with '\0'.
Hmm.  Is the plumbing really that broken that you need to add -z
support to porcelain rather than using the -z support already built
into the plumbing?
 
>  * Remove all untracked files:
> 
>    git status -z | gawk 'BEGIN{RS="\0"; ORS="\0";}/^untracked/ \
> 	{sub("^.+:", "");print}' | xargs -0 -r rm
That I take it is just the long handed way to write `git clean -f` ?
 
>  * List all updated file regardless the modification:
> 
>    git status -z | gawk 'BEGIN{RS="\0"; ORS="\0";}/^updated/ \
> 	{sub("^.+:", "");print}' | xargs -0 -n 1
And this is just the long handed way to write `git diff --name-only` ?

A very large and intrusive looking patch for what can already be obtained easier through existing, stable porcelain. Not something I am in favor of seeing added at this time.

-- 
Shawn.
Previous: Sebastien GrossNext: Johannes Schindelin
Message 2 of 5 in “Add a -z option to 'git status' to safely feed shell programs with path names”
  1. Add a -z option to 'git status' to safely feed shell programs with path namesSebastien Gross, May 17, 2008
  2. Shawn O. PearceMay 17, 2008
  3. Johannes SchindelinMay 17, 2008
  4. Mike HommeyMay 17, 2008
  5. Johannes SchindelinMay 17, 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.