From b293ca4bcbf95b9a85ecf9a4c786371ec9aa3e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C5=91d=20Ill=C3=A9s?= Date: Thu, 4 Feb 2021 12:35:12 +0100 Subject: [PATCH] Optional list of changes in commit message for auto release When generating release patches with process_auto_releases.sh it could be useful to have the list of changes in the commit message of the release patch. This patch adds an extra question for that. Change-Id: I8f26fb5655ef1cd280b243cadbb7b49d596e7d51 --- tools/process_auto_releases.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/process_auto_releases.sh b/tools/process_auto_releases.sh index 8f044a2c05..72e81e6eb6 100755 --- a/tools/process_auto_releases.sh +++ b/tools/process_auto_releases.sh @@ -69,15 +69,21 @@ read -p "> Create stable branch? [y/N]: " YN if [ "${YN,,}" == "y" ]; then newbranch="--stable-branch" fi +echo +read -p "> Append list of changes to commit message? [y/N]: " YN +if [ "${YN,,}" == "y" ]; then + append_change_list="yes" +fi echo echo "======================================" echo "Confirm details:" echo "======================================" -echo "Topic: $topic" -echo "Series: $series" -echo "Branch: $branch" -echo "New Branch: $newbranch" +echo "Topic: $topic" +echo "Series: $series" +echo "Branch: $branch" +echo "New Branch: $newbranch" +echo "Change list: $append_change_list" echo "Commit Message Template:" echo echo "------------------------------------------------------------------------" @@ -92,6 +98,7 @@ fi function process_repo { repo=$1 + change_list="" title "Unreleased changes in $repo ($series)" cd "$MYTMPDIR" clone_repo "openstack/$repo" $branch @@ -110,6 +117,13 @@ function process_repo { git log --no-color --no-merges --format='%h %ci %s' \ --graph ${prev_tag}..${end_sha} echo + if [ -n "$append_change_list" ]; then + change_list=" + +$ git log --oneline --no-merges ${prev_tag}..${end_sha} +$(git log --oneline --no-merges ${prev_tag}..${end_sha}) +" + fi fi read -p "Create new release? [y/N]: " YN @@ -132,7 +146,7 @@ function process_repo { break done git add . - message=${commit//PROJECT/$repo} + message="${commit//PROJECT/$repo}${change_list}" git commit -s -m "$message" git log -1 git review -t $topic