Possible Duplicate:
Git pre-commit hook : changed/added files
It may be good to add a code verifier or checker of some sort before you commit a list of source codes. Facebook even integrated automated tests into the committing process( or so I heard). What I need is a way to get the list of files that is going to be committed, not just edited. Here is a few reasons for this:
git commit -m "message"
can modify default message bypasses prepare-message and commit-msg hooks when I tried to use them to get files.- pre-commit hook do not get any arguments from the
git commit
command so it is not easy to tell what files are being committed, especially from a partial commit. - We have multiple users on one shared workstation, one shared user and one shared local repository( I can do nothing about it, I just do my job there ), so I do not want to verify other's codes when I commit mine (pretty sure this feeling is mutual). So if I use
git diff-index --name-only HEAD
, I get more codes to verify than I want to. - Automation is awesome and I think it's cool to install a code verifier in the hooks.
- The committing process has better to be aborted if the verification fails.
If there is any other way to automatically verify the codes in the ways that I described, pleeease tell me how. I really need this. Thank you very much.