3 ms·
Why is this interesting? pre-commit triggers were in BitKeeper, what, 10 years ago? Did I miss something exciting here?
by luckydude 17y ago
Why is this interesting? pre-commit triggers were in BitKeeper, what, 10 years ago?
Did I miss something exciting here?
- leftnode 17y agoMost 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.
- etherealG 17y agoit's interesting cause it's useful and many people probably don't know about it.
- icefox 17y agoIt is interesting because every time I ask someone what hooks they use on their git repos they look at me with a blank face. There are so many useful things you can do with commit hooks. I have written dozens of hooks for my repositories. Spell checking my commit message and running the unit test on the file I just committed (and only that file) are the two bare minimum basic hooks that I always install, but there are dozens more depending on the repository. I wrote up a bunch of different ones I used last year on a blog entry: http://benjamin-meyer.blogspot.com/2008/10/git-hooks.html http://benjamin-meyer.blogspot.com/2008/10/git-hooks.html Think of it as the next level of unit testing. Have some bash scripts that you occasionally put an error in? add a bash -n hook on bash files to prevent mistakes. In the Arora repository there have been probably a dozen commits total that broke the build on one of the platforms. How many build breakage commits do you have in your repo? Speaking of this, the ruby on rails guys seems to be really for tests, but to run a test (even the hello world return true one) takes several seconds... how do I improve this to take ms?