From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gelonida Subject: Re: simple example for git hooks Date: Fri, 03 Sep 2010 00:54:44 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Sep 03 00:55:17 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OrIgY-00071O-I2 for gcvg-git-2@lo.gmane.org; Fri, 03 Sep 2010 00:55:10 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753371Ab0IBWzD convert rfc822-to-quoted-printable (ORCPT ); Thu, 2 Sep 2010 18:55:03 -0400 Received: from lo.gmane.org ([80.91.229.12]:42405 "EHLO lo.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751217Ab0IBWzB (ORCPT ); Thu, 2 Sep 2010 18:55:01 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OrIgJ-0006l2-RT for git@vger.kernel.org; Fri, 03 Sep 2010 00:54:55 +0200 Received: from unicorn.dungeon.de ([81.56.82.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Sep 2010 00:54:55 +0200 Received: from gelonida by unicorn.dungeon.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Sep 2010 00:54:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: unicorn.dungeon.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 "" In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Him THanks a lot for your answer. On 09/03/2010 12:49 AM, =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason wrote: > On Thu, Sep 2, 2010 at 22:41, Gelonida wrote: >=20 >> Is there any clear documentation about hich git commands I'm allowed= to >> use during a trigger script and which ones I can't >=20 > It's just a program that's run at a certain point, and its exit statu= s > determines if git proceeds. >=20 > So you can use any git command, but of course what you might affect > what's about to be commited. >=20 > 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