From 0aec2d73847c74ce783293682b6bc60665ed5d93 Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Wed, 24 Apr 2013 14:56:53 -0700 Subject: Added commit-msg script for issues tracking which autogen installs. [endlessm/eos-sdk#35] --- autogen.sh | 6 ++++++ commit-msg | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 commit-msg diff --git a/autogen.sh b/autogen.sh index b462eec..6c20886 100755 --- a/autogen.sh +++ b/autogen.sh @@ -14,6 +14,12 @@ test -f $FILE_MUST_EXIST || { exit 1 } +# Install our commit message script if a git repo +if [ -d .git ]; then + cp commit-msg .git/hooks/commit-msg + chmod +x .git/hooks/commit-msg +fi + # GNU gettext automake support doesn't get along with git # https://bugzilla.gnome.org/show_bug.cgi?id=661128 touch -t 200001010000 $POT_FILE diff --git a/commit-msg b/commit-msg new file mode 100644 index 0000000..5977945 --- /dev/null +++ b/commit-msg @@ -0,0 +1,14 @@ +#!/bin/bash + +# move this script to the .git/hooks directory for your repo. +# make sure to chmod +x .git/hooks/commit-msg + +branch=`git rev-parse --abbrev-ref HEAD` + +if [[ $branch == issues/* ]]; then + link=$(echo $branch | awk -F/ '{ print "[endlessm/eos-sdk#"$2"]" }') + echo "issue link: $link" + echo $link >> $1 +fi + +exit 0 -- cgit v1.2.3