| Previous · Next | |
| User | Message |
|
perlDreamer
|
Date: 10/30/2009 7:19 pm · Subject: git pre-commit hook · Rating: 1
Yesterday, I committed a broken test. Being the person who always encourages (nags) people to always run the tests before committing them, it was particularly embarrasing to find. I did some digging around, and found that git committers can setup their own pre-commit hooks, so I wrote one that runs only the 00_compile.t test before allowing me to commit. 00_compile.t runs very quickly. Git stores hooks in the .git directory for the repo, so you would add this file to as .git/hooks/pre-commit. You'll need to modify it to point to some valid WebGUI configuration file. The test does no database writes, so any configuration file will work.
Attached Files |
| Back to Top |
Rate [ | ]
|
|
JT
|
Date: 11/6/2009 10:20 am · Subject: Re: git pre-commit hook · Rating: 1
I think this sounds like a great idea, but we should make it easier to add for developers. I'm thinking we should have a file in the repository with all our pre-commit hooks built in. And this file should be in the format that git is expecting (that shell script). Then the dev would only have to: ln -s /data/WebGUI/path/to/pre-commit /data/WebGUI/.git/hooks/pre-commit And they'd be done. |
| Back to Top |
Rate [ | ]
|