aboutsummaryrefslogtreecommitdiffstats
path: root/git-tools
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-08 00:50:48 +0100
committerNils Adermann <naderman@naderman.de>2010-03-08 00:50:48 +0100
commit9f8d258de484bebbe481213c66355f02164afb1f (patch)
tree4e2bcfedeb6d9c57b485b46808b19a30d37cb30e /git-tools
parent23141a2c519a62161a21196a8b045218f8717bd4 (diff)
parentd0d1ab54710f7a7f3426b2bcdfd63e9df24c046e (diff)
downloadforums-9f8d258de484bebbe481213c66355f02164afb1f.tar
forums-9f8d258de484bebbe481213c66355f02164afb1f.tar.gz
forums-9f8d258de484bebbe481213c66355f02164afb1f.tar.bz2
forums-9f8d258de484bebbe481213c66355f02164afb1f.tar.xz
forums-9f8d258de484bebbe481213c66355f02164afb1f.zip
Merge branch 'develop-olympus' of git://github.com/evil3/phpbb3 into develop-olympus
Diffstat (limited to 'git-tools')
-rwxr-xr-xgit-tools/hooks/prepare-commit-msg24
1 files changed, 24 insertions, 0 deletions
diff --git a/git-tools/hooks/prepare-commit-msg b/git-tools/hooks/prepare-commit-msg
new file mode 100755
index 0000000000..284354081e
--- /dev/null
+++ b/git-tools/hooks/prepare-commit-msg
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# A hook to add [$branch] to the beginning of a commit message
+# if certain conditions are met.
+#
+# This is a prepare-commit-msg hook.
+#
+# To install this you can either copy or symlink it to
+# $GIT_DIR/hooks, example:
+#
+# ln -s ../../git-tools/hooks/prepare-commit-msg \\
+# .git/hooks/prepare-commit-msg
+#
+# Make sure it is executable.
+
+# strip off ref: refs/heads/
+branch="$(cat $GIT_DIR/HEAD | sed 's/ref: refs\/heads\///g')"
+
+# * only run when normal commit is made (without -m or -F;
+# not a merge, etc.)
+# * also make sure the branch name begins with bug/
+if [ "$2" = "" ] && [ $(echo "$branch" | grep -e '^bug/') ]; then
+ echo "[$branch] $(cat $1)" > "$1"
+fi