]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
git: enable whitespace checking commit hook during in autogen.sh
authorLennart Poettering <lennart@poettering.net>
Tue, 12 May 2009 23:56:54 +0000 (01:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 May 2009 00:09:32 +0000 (02:09 +0200)
Trailing whitespace sucks. This change modifies autogen.sh to activate
the example pre-commit that ships with git. It will make sure that from
then on no further commits with trailing whitespace can be made

autogen.sh

index 76561338d46a8b2f66d38aa00591035d25666ed9..bf53b2770f96bdca0a8349ec3247845a8c093e24 100755 (executable)
@@ -13,6 +13,12 @@ FILE=dbus-1.pc.in
 
 DIE=0
 
+if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
+    echo "Activating pre-commit hook."
+    cp -av .git/hooks/pre-commit.sample .git/hooks/pre-commit
+    chmod -c +x  .git/hooks/pre-commit
+fi
+
 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
        echo
        echo "You must have autoconf installed to compile $PROJECT."