simple example for git hooks

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

 



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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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