From 078d3cb0385710fb027fa9f4a39680964b281ba5 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Fri, 26 Nov 2021 11:42:45 -0500 Subject: [PATCH] branching: don't push branches and tags in a single command The command 'git push --tags ${review_remote} ${branch}' is trying to push the branch and tag at the same time, and as a side effect is re-pushing all other known tags. Upstream servers are now consistently rejecting this. Either they only accept a single branch or tag per push, or they reject duplicate tags that they already have, even if unchanged. Change the code to push the branch and tag independently. Closes-bug: 1952472 Change-Id: If99123b1eae823ea05ee2b2c80f891cb189e18d3 Signed-off-by: Scott Little --- build-tools/branching/push_branches_tags.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build-tools/branching/push_branches_tags.sh b/build-tools/branching/push_branches_tags.sh index cc864557..23f2feb3 100755 --- a/build-tools/branching/push_branches_tags.sh +++ b/build-tools/branching/push_branches_tags.sh @@ -234,12 +234,16 @@ for subgit in $SUBGITS; do $DRY_RUN_CMD git config --local --replace-all "branch.${branch}.merge" refs/heads/${branch} && \ $DRY_RUN_CMD git review --topic="${branch}" else - echo "git push --tags ${review_remote} ${branch} $DRY_RUN" - git push --tags ${review_remote} ${branch} $DRY_RUN + echo "git push ${review_remote} ${branch}:${branch} $DRY_RUN" + git push ${review_remote} ${branch}:${branch} $DRY_RUN + echo "git push ${review_remote} ${tag}:${tag} $DRY_RUN" + git push ${review_remote} ${tag}:${tag} $DRY_RUN fi else - echo "git push --tags --set-upstream ${remote} ${branch} $DRY_RUN" - git push --tags --set-upstream ${remote} ${branch} $DRY_RUN + echo "git push ${remote} ${branch}:${branch} $DRY_RUN" + git push ${remote} ${branch}:${branch} $DRY_RUN + echo "git push ${remote} ${tag}:${tag} $DRY_RUN" + git push ${remote} ${tag}:${tag} $DRY_RUN fi if [ $? != 0 ] ; then