3 # use as .git/hooks/pre-commit
8 changed=$(git diff --cached --name-only)
13 if echo $f | grep \\.[c,h]\$ > /dev/null
15 # compare result of uncrustify with changes
17 # only change any of the invocations here if
18 # they are portable across all cmp and shell
20 uncrustify -q -c uncrustify.cfg -f $f | cmp -s $f -
23 crustified=" $crustified $f"
32 echo "uncrustify --no-backup -c uncrustify.cfg ${crustified}"
33 echo "before commiting."