script: publish script showing commit messages as comment below template

This commit is contained in:
Eberhard Graether
2014-07-17 16:17:32 +02:00
parent 2d7af3dda2
commit 0c570d54af
+7 -1
View File
@@ -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