X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fgerrit-push-patch.sh;h=aae77f5947447221227aa6fd26654af466cfbb57;hb=c8b9acd166fcbd88139a65f7721e522980a0e013;hp=b33f0f521c0fd8d543e6472b3ae1700176211248;hpb=3ca80e4b7818ebe309abc3ddcabe7086f1ed2d18;p=releng%2Fglobal-jjb.git diff --git a/shell/gerrit-push-patch.sh b/shell/gerrit-push-patch.sh index b33f0f52..aae77f59 100644 --- a/shell/gerrit-push-patch.sh +++ b/shell/gerrit-push-patch.sh @@ -47,7 +47,7 @@ echo -e "INFO: Staged for commit:\n$staged_commits\n" # shellcheck disable=SC1090 source ~/lf-env.sh -lf-activate-venv "git-review>=1.28" +lf-activate-venv "git-review==1.28" # Query for a pre-existing gerrit review query_result=$(ssh -p 29418 "$GERRIT_USER@$GERRIT_HOST" gerrit query \ @@ -60,12 +60,14 @@ job=$JOB_NAME/$BUILD_NUMBER # If available, add change_id to commit message if change_id=$(echo "$query_result" | grep 'Change-Id:' | awk '{print $2}'); then echo "NOTE: Found gerrit review: $change_id" - message="Job: $job\nChange-Id: $change_id" + message="Job: $job"$'\n'"Change-Id: $change_id" else echo "NOTE: No gerrit review found" message="Job: $job" fi -git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "$message" +git commit -sm "$GERRIT_COMMIT_MESSAGE + +$message" git status git remote add gerrit "ssh://$GERRIT_USER@$GERRIT_HOST:29418/$PROJECT.git"