notmuch.git  about / heads / tags
Unnamed repository; edit this file 'description' to name the repository.
blob eca5fb966a06d184a46ac8773e213d2fd7de884f 552 bytes (raw)
name: devel/check-notmuch-commit 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

git clone https://yhetil.org/notmuch.git