From 0c570d54af9cf67e2c5f734ec5efdcdeb9d64f19 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Thu, 17 Jul 2014 16:17:32 +0200 Subject: [PATCH] script: publish script showing commit messages as comment below template --- script/git-publish.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/git-publish.sh b/script/git-publish.sh index 1c7eeb80..f93ca1e1 100755 --- a/script/git-publish.sh +++ b/script/git-publish.sh @@ -66,12 +66,18 @@ then exit 1 fi +# Prepare publish message with commit messages +GIT_DIR=$(git rev-parse --show-toplevel)/.git +cat $GIT_DIR/../.git_commit_template.txt > $GIT_DIR/PUBLISH_MSG +printf "\n# commits:\n" >> $GIT_DIR/PUBLISH_MSG +git log --graph --format=%B $BASE_COMMIT..HEAD | sed 's/^/# &/' >> $GIT_DIR/PUBLISH_MSG + # switch to temporary branch for squashing git checkout -q -b $PUBLISH_BRANCH_NAME echo -e $INFO "Squashing commits" git reset --soft $BASE_COMMIT -git commit +git commit --template=$GIT_DIR/PUBLISH_MSG if [ $? != 0 ] then