From 95be04e36da4861329ae57a4f9f1bf2ce69b97a6 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 27 Mar 2013 02:30:17 -0400 Subject: [PATCH] CRM-12109 - Call git-footnote in commit-msg hook ---------------------------------------- * CRM-12109: Automatically append JIRA links to Git tickets http://issues.civicrm.org/jira/browse/CRM-12109 --- tools/scripts/git/commit-msg | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/scripts/git/commit-msg b/tools/scripts/git/commit-msg index 0017268479..93d0df6934 100755 --- a/tools/scripts/git/commit-msg +++ b/tools/scripts/git/commit-msg @@ -2,4 +2,18 @@ # Note: This shell script should be designed and tested for cross-platform use -# Reserved for future use \ No newline at end of file +set -e + +if [ "$GIT_CANONICAL_REPO_NAME" = "civicrm-core" ]; then + PACKAGES="$GIT_DIR/../packages" +else + PACKAGES="$GIT_DIR/../../packages" +fi + +if [ -f "$PACKAGES/git-footnote/bin/git-footnote" ]; then + FILE="$1" + TMPFILE="$1.jira" + cp -p "$FILE" "$TMPFILE" + $PACKAGES/git-footnote/bin/git-footnote CRM http://issues.civicrm.org/jira < "$TMPFILE" > "$FILE" + rm -f "$TMPFILE" +fi -- 2.25.1