$ cd qemu $ cat >.git/hooks/pre-commit #!/bin/bash exec git diff --cached | scripts/checkpatch.pl --no-signoff -q - ^D $ chmod 755 .git/hooks/pre-commit
Any commit that violates the coding standard as checked by checkpatch.pl will be aborted. I am running with this git hook now and will post any tweaks I make to it.
Update: If you encounter a false positive because checkpatch.pl is complaining about code you didn't touch, use git commit --no-verify to override the pre-commit hook. Use this trick sparingly :-).
How did you manage to force commit if messages are false positive?
ReplyDeleteI have updated the post to mention the git commit --no-verify option which lets you override the pre-commit hook. This is the solution you are looking for.
DeleteI did a post on my site based on your article.
ReplyDeleteI tried to keep the source material and mention that I based on his work, the purpose of my post is to record the steps needed for those who are beginning to study the QEMU to become a developer.
The post is being built according to demand that I have knowledge.
http://carlosdelfino.eti.br/logicadeprogramacao/Preparando_o_Ambiente_Para_Estudar_o_QEMU/
Thanks Stefan, let's also recommend running pycodestyle, for ex:
ReplyDelete#!/bin/bash
set -e
git diff --cached | pycodestyle --diff
git diff --cached | scripts/checkpatch.pl --no-signoff -q -
I tried to keep the source material and mention that I based on his work, the purpose of my post is to record the steps needed for those who are beginning to study the QEMU to become a developer.Daniel Ballerini
ReplyDelete