git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hommey <mh@glandium.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Sebastien Gross <seb-git@chezwam.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] Add a -z option to 'git status' to safely feed shell programs with path names
Date: Sat, 17 May 2008 12:26:00 +0200	[thread overview]
Message-ID: <20080517102600.GA10290@glandium.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0805171109000.30431@racer>

On Sat, May 17, 2008 at 11:14:01AM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Fri, 16 May 2008, Shawn O. Pearce wrote:
> 
> > 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?
> 
> To answer the retorical question: no, it is not.  git ls-files already has 
> the "-z" flag, and we even have the scripts in contrib/examples/ to prove 
> that it works very fine, thankyouverymuch.
> 
> Just as an example: this ugly, long line
> 
> git status -z | gawk 'BEGIN{RS="\0"; ORS="\0";}/^untracked/ \
>         {sub("^.+:", "");print}' | xargs -0 -r rm
> 
> could be expressed like this:
> 
> git ls-files --others -z | xargs -0 -r rm

or git clean -f

Mike

  reply	other threads:[~2008-05-17 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-17  2:33 [PATCH] Add a -z option to 'git status' to safely feed shell programs with path names Sebastien Gross
2008-05-17  2:51 ` Shawn O. Pearce
2008-05-17 10:14   ` Johannes Schindelin
2008-05-17 10:26     ` Mike Hommey [this message]
2008-05-17 11:02       ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080517102600.GA10290@glandium.org \
    --to=mh@glandium.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=seb-git@chezwam.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).