git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gelonida <gelonida@gmail.com>
To: git@vger.kernel.org
Subject: Re: simple example for git hooks
Date: Fri, 03 Sep 2010 00:54:44 +0200	[thread overview]
Message-ID: <i5p9vl$tk$1@dough.gmane.org> (raw)
In-Reply-To: <AANLkTimEo=sV=bKHyuQ5Md_7uQ0jAFKx+=dv4+KK+oD7@mail.gmail.com>

Him
THanks a lot for your answer.

On 09/03/2010 12:49 AM, Ævar Arnfjörð Bjarmason wrote:
> On Thu, Sep 2, 2010 at 22:41, Gelonida <gelonida@gmail.com> wrote:
> 
>> Is there any clear documentation about hich git commands I'm allowed to
>> use during a trigger script and which ones I can't
> 
> It's just a program that's run at a certain point, and its exit status
> determines if git proceeds.
> 
> So you can use any git command, but of course what you might affect
> what's about to be commited.
> 
> For a pre-commit hook (IIRC) you should find the stuff to be commited
> in the index, finding a list of things that changed from a hook is
> just a matter of diffing HEAD against the contents of the index then.

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.

I use git for quite some time, but don't know many commands except
clone/pull/commit/reset/status/pull/push/cherrypick/rebase/tag/remote

thanks a lot for the typical way to identify added / modified files
and for fetching the commit comment

  reply	other threads:[~2010-09-02 22:55 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 [this message]
2010-09-03  9:43     ` Knut Franke
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='i5p9vl$tk$1@dough.gmane.org' \
    --to=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).