]> rtime.felk.cvut.cz Git - orte.git/blob - orte/uncrustify
Add configuration for uncrustify
[orte.git] / orte / uncrustify
1 #!/bin/sh
2
3 # Usage: Run this script and then 'git add -p' to commit the changes
4 # you agree with.
5
6 if ! git diff --quiet; then
7     echo >&2 "Error: Uncommited changes in worktree"
8     exit 1
9 fi
10
11 UNCRUSTIFY_CFG=${UNCRUSTIFY_CFG:-$0.cfg}
12
13 git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$/ {print $1}'|\
14     while read file; do
15         git show HEAD:$file | (set -x; uncrustify -c $UNCRUSTIFY_CFG -o $file)
16     done