From: Jamo Luhrsen Date: Thu, 12 Dec 2019 20:25:36 +0000 (-0800) Subject: Add JOB info to commit message X-Git-Tag: v0.49.0~6^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F62615%2F3;p=releng%2Fglobal-jjb.git Add JOB info to commit message Signed-off-by: Jamo Luhrsen Change-Id: Icb6e7e40752a1c6f91b2c0f73c9cefc4ccfb91de Signed-off-by: Jamo Luhrsen --- 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