Re: simple example for git hooks

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

 



On Friday 03 September 2010 00:54:44 Gelonida wrote:
> ok, so it seems what I'm missing is THE command to list all added /
> modified files
> I could of course use
> 
> git status
> 
> and parse its output, but this is probably not the right way to do.

Not unless you use the --porcelain option, which is explicitly meant to produce
parsable output.

For instance, if "a" has staged modifications, "b" has unstaged modifications
and  "c" is added (and staged), you'll get

$ git status --porcelain    
M  a                                           
 M b                                           
A  c

i.e. the first character in a line denotes the difference between HEAD and
index and the second character denotes the difference between index and
working copy.
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

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