On Tuesday, January 13, 2015 at 8:35:05 PM UTC+1, 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/ 
> <http://www.google.com/url?q=http%3A%2F%2Funcrustify.sourceforge.net%2F&sa=D&sntz=1&usg=AFQjCNEnJIsmeupSXUqmF3aTnQVsu27PfA>
> https://github.com/bengardner/uncrustify
> But i don't know how to implement. Yes it can be bash or powershell script.
> Thanks,

You may want to have a look server side hooks here: 

I would be wary of doing these kinds of checks in a hook the way you plan. 
I like more the approach where code is suggested using pull- or change 
requests in pushed branches - and then automatic build agents run 
stylecheckers against those branches, before they are allowed to be merged 
to the main branch.

Alternatively, I would try motivating developers to run style-checkers 
locally before pushing (many IDEs can do this continuously). Putting 
obstacles in way of developers is not a good motivator. It's better to 
improve tools and culture to make their job easier.

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