X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=devel%2Fcheck-notmuch-commit;fp=devel%2Fcheck-notmuch-commit;h=eca5fb966a06d184a46ac8773e213d2fd7de884f;hb=a4b1c3933137ca71793f185a82c44442233c2b46;hp=0000000000000000000000000000000000000000;hpb=6e050de4c01107ad0d914170aacf261701d2b71c;p=notmuch diff --git a/devel/check-notmuch-commit b/devel/check-notmuch-commit new file mode 100755 index 00000000..eca5fb96 --- /dev/null +++ b/devel/check-notmuch-commit @@ -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