From f105e37a3e42a2d1503d621464a556b8baaa57b0 Mon Sep 17 00:00:00 2001 From: Jamo Luhrsen Date: Thu, 12 Dec 2019 12:25:36 -0800 Subject: [PATCH] Add JOB info to commit message Signed-off-by: Jamo Luhrsen Change-Id: Icb6e7e40752a1c6f91b2c0f73c9cefc4ccfb91de Signed-off-by: Jamo Luhrsen --- shell/gerrit-push-patch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/gerrit-push-patch.sh b/shell/gerrit-push-patch.sh index 62f8e9be..d0a77fe1 100644 --- a/shell/gerrit-push-patch.sh +++ b/shell/gerrit-push-patch.sh @@ -50,6 +50,7 @@ GERRIT_HOST="$(echo "$GERRIT_HOST" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")" GERRIT_TOPIC="$(echo "$GERRIT_TOPIC" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")" GERRIT_USER="$(echo "$GERRIT_USER" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")" REVIEWERS_EMAIL="$(echo "$REVIEWERS_EMAIL" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")" +job=$JOB_NAME/$BUILD_NUMBER CHANGE_ID=$(ssh -p 29418 "$GERRIT_USER@$GERRIT_HOST" gerrit query \ limit:1 owner:self is:open project:"$PROJECT" \ @@ -59,9 +60,9 @@ CHANGE_ID=$(ssh -p 29418 "$GERRIT_USER@$GERRIT_HOST" gerrit query \ awk '{ print $2 }') if [ -z "$CHANGE_ID" ]; then - git commit -sm "$GERRIT_COMMIT_MESSAGE" + git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "Job: ${job}" else - git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "Change-Id: $CHANGE_ID" + git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "Job: ${job}\nChange-Id: $CHANGE_ID" fi git status -- 2.16.6