
Git Hooks - pre-commit - leftnode
http://leftnode.com/git-hooks-pre-commit/
======
mnemonik
Just posted this to the blog, thought I would repost here too:

I recently wrote a pre-commit hook that runs pylint on my Python files.

<http://fitzgeraldnick.com/weblog/9/>

“git diff –staged –name-only HEAD” will get you the files that are about to be
committed and then you can check if they end with “.php” (or “.py” in my case)
and go from there. I also check to see if “#!” and “python” are in the first
line of a file because my pre-commit hook is written in python but doesn’t
have an extension, just a crunch bang.

------
philjackson
I use pre-commit to check if I've left any software breakpoints in my code.
Very handy.

------
luckydude
Why is this interesting? pre-commit triggers were in BitKeeper, what, 10 years
ago?

Did I miss something exciting here?

~~~
leftnode
Most version control systems have hooks, I recently ported one of my
subversion hooks to git and decided to blog about it.

I figured it'd probably help someone out there, which is why I submitted it to
HN.

