summaryrefslogtreecommitdiff
path: root/pre-commit
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-05-29 00:46:26 +0000
committerChristian Grothoff <christian@grothoff.org>2009-05-29 00:46:26 +0000
commit0a217a8df1657b4334b55b0e4a6c7837a8dbcfd9 (patch)
tree6b552f40eb089db96409a312a98d9b12bd669102 /pre-commit
ng
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
+