git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* simple example for git hooks
@ 2010-09-02 22:41 Gelonida
  2010-09-02 22:49 ` Ævar Arnfjörð Bjarmason
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gelonida @ 2010-09-02 22:41 UTC (permalink / raw)
  To: git

Does anyone have a simple example of a git pre-commit hook


I have difficulties finding understandable tutorals about git hooks.




What I am looking at is basic examples about


precommit hooks
================

- how get the commit comment and check it's contents
- how to get list of modified files

The issue I'm currently blocked with is rather simple.

I'd like to get a list aof all
new or modified file names, such, that I can check, that for  example
all .h files contain a project specific header.


As soon as I have the file names I should be able to proceed.


How could I do this best from a shell script.





Is there any clear documentation about hich git commands I'm allowed to
use during a trigger script and which ones I can't



Lateron I would be interested to implement a small server script, that
refuses a git push in case, that the most recent commit in a branch
would contain .h files without a certain header text




thanks for your help

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-05 21:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-09-03 20:37 ` Neal Kreitzinger
2010-09-05 21:48 ` Gelonida

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).