summaryrefslogtreecommitdiff
path: root/pre-commit
diff options
context:
space:
mode:
Diffstat (limited to 'pre-commit')
-rwxr-xr-xpre-commit17
1 files changed, 17 insertions, 0 deletions
diff --git a/pre-commit b/pre-commit
new file mode 100755
index 000000000..b733c44fa
--- /dev/null
+++ b/pre-commit
@@ -0,0 +1,17 @@
+#!/bin/sh
+# NOTE: "touch mydir/no-indent" to make the tree starting at mydir untouchable
+l=""
+for n in `find . -name "no-indent"`
+do
+ n=`dirname "$n"`
+ l="-and -not -path \"$n/*\" $l"
+done
+indent -nut `echo $l | xargs find . -name "*.c"`
+indent -nut `echo $l | xargs find . -name "*.h"`
+if test -x "`which 'dos2unix'`"
+then
+ dos2unix -ko `echo $l | xargs find . -name "*.c"`
+ dos2unix -ko `echo $l | xargs find . -name "*.h"`
+ rm `echo $l | xargs find . -name "*.?~"`
+fi
+