On 01/13/2015 02:35 PM, Marko Paloski wrote:
> Hello,
> I want to make i script that check the code style in the commit, so if
> don't matches, it will not allow the developers to commit the code.
> The script will be in pre-commit local or in pre-recieve on the server.
> I find something about uncrustify :
> http://www.itk.org/pipermail/insight-developers/2010-September/015333.html
> http://uncrustify.sourceforge.net/
> https://github.com/bengardner/uncrustify
> But i don't know how to implement. Yes it can be bash or powershell script.
> Thanks,

In the file .git/hooks/precommit you run the uncrustify analysis and
depending on the result, you exit the script with 0 if it was ok, and 1
if it was not ok.

If you exit with a 1 the commit will not be done.

Peter van der Does

GPG key: CB317D6E

Site: http://avirtualhome.com
GitHub: https://github.com/petervanderdoes
Twitter: @petervanderdoes

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to