Re: Suggestion: git status --untracked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Rafael Garcia-Suarez" <rgarciasuarez@xxxxxxxxx> writes:

> I find myself wanting sometimes to filter out the output of
> git-status, to feed it to another command (for example, git-add, or
> rm, or cat >> .gitignore). However it's not currently very easy to
> parse in a one-liner.
>
> I'm suggesting to add options to control this behaviour. My suggestion
> would be (for a start) to add an option --untracked that will list all
> untracked files on stdout, without a leading "#\t", and without
> listing the added / modified / removed files.

Actually, it's already available (since a few weeks in master IIRC,
not sure whether it's in the latest release), as

  git ls-files --exclude-standard -o

The --exclude-standard tells git ls-files to read .gitignore and
friends as most commands do, and -o means "show 'other' files".

Older gits didn't have the --exclude-standard, so you had to say
--exclude-from=.git/info/exclude --exclude-per-directory=.gitignore
(or stg like that) instead.

-- 
Matthieu
-
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux