git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Knut Franke <k.franke@science-computing.de>
To: Gelonida <gelonida@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: simple example for git hooks
Date: Fri, 3 Sep 2010 11:43:08 +0200	[thread overview]
Message-ID: <201009031143.10539.k.franke@science-computing.de> (raw)
In-Reply-To: <i5p9vl$tk$1@dough.gmane.org>

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 


  reply	other threads:[~2010-09-03  9:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-02 22:41 simple example for git hooks Gelonida
2010-09-02 22:49 ` Ævar Arnfjörð Bjarmason
2010-09-02 22:54   ` Gelonida
2010-09-03  9:43     ` Knut Franke [this message]
2010-09-03 20:37 ` Neal Kreitzinger
2010-09-05 21:48 ` Gelonida

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=201009031143.10539.k.franke@science-computing.de \
    --to=k.franke@science-computing.de \
    --cc=gelonida@gmail.com \
    --cc=git@vger.kernel.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).