mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
devel: script for checking a commit (series)
'check-notmuch-commit' is an updated version of a script I have been using (although not always as consistently as I should) before sending patches to the list. Although it requires a bit more tooling, encouraging people to use check-notmuch-commit might reduce the number of round trips to the list for style nitpicks.
This commit is contained in:
parent
6e050de4c0
commit
a4b1c39331
1 changed files with 31 additions and 0 deletions
31
devel/check-notmuch-commit
Executable file
31
devel/check-notmuch-commit
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Usage suggestion:
|
||||
# git rebase -i --exec devel/check-notmuch-commit origin/master
|
||||
|
||||
set -e
|
||||
|
||||
quick=0
|
||||
case "$1" in
|
||||
-q|-Q|--quick)
|
||||
quick=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $quick = 0 ]; then
|
||||
make test
|
||||
fi
|
||||
|
||||
unset uconf
|
||||
for file in $(git diff --name-only --diff-filter=AM HEAD^); do
|
||||
case $file in
|
||||
*.c|*.h|*.cc|*.hh)
|
||||
uncrustify --replace -c "${uconf=$(dirname "$0")/uncrustify.cfg}" "$file"
|
||||
;;
|
||||
*.el)
|
||||
emacs -Q --batch "$file" --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git diff --quiet
|
Loading…
Reference in a new issue