Re: [PATCH] Add a -z option to 'git status' to safely feed shell programs with path names | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
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@xxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Newbies FAQ] [Kernel List] [Site Home] [Free Online Dating] [Gcc Help] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [V4L] [Bugtraq] [Free Online Dating] [Rubini] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [DDR & Rambus] [Linux Resources]