Re: How to check repository/working tree status from a script

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

 



Marc Haber schrieb:
> On Tue, May 19, 2009 at 09:18:12AM -0700, Linus Torvalds wrote:
>> And if what you want to know about is whether there are _new_ files you 
>> might want to check, then you need a third check: 'git ls-files'. You 
>> won't see it in the error code, but you can do
>>
>> 	others=$(git ls-files -o --exclude-standard)
>>
>> and then check it 'others' is empty or not.
> 
> So parsing the output is both the canonical and only way to do so
> since there is no meaningful exit code? Can I assume that the
> formatting of git output is not subject to change?

See 'man git':

"Porcelain" commands are *not* for use in scripts; their output may
change. git diff, git status, git commit, git checkout are in this category.

"Plumbing" commands are for use in scripts and their output will not
change. git ls-files, git diff-tree, git diff-files are in this category.

-- Hannes
--
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]