diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-08-26 09:58:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-08-26 09:58:38 -0400 |
commit | ca667b9a8a654703b26e666d197e1f093eff2e89 (patch) | |
tree | 49b32a0f422b9008accd7cf74a05a5e90daf999e /scripts/git/git-push-all.sh | |
parent | 24bc2cd7b5ab32d6a34dee3a27d5d383a383b270 (diff) | |
download | tor-ca667b9a8a654703b26e666d197e1f093eff2e89.tar.gz tor-ca667b9a8a654703b26e666d197e1f093eff2e89.zip |
Fix/suppress shellcheck warnings in git-push-all.sh
(I've chosen to suppress some instances rather than 'fix' them,
since the fix would require arrays or major refactoring.)
Fixes bug 31519; bug not in any released Tor.
Diffstat (limited to 'scripts/git/git-push-all.sh')
-rwxr-xr-x | scripts/git/git-push-all.sh | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/scripts/git/git-push-all.sh b/scripts/git/git-push-all.sh index 1ae310eca4..469d6fe570 100755 --- a/scripts/git/git-push-all.sh +++ b/scripts/git/git-push-all.sh @@ -15,30 +15,37 @@ UPSTREAM_REMOTE=${TOR_UPSTREAM_REMOTE_NAME:-"upstream"} # Add a delay between pushes, so CI runs on the most important branches first PUSH_DELAY=${TOR_PUSH_DELAY:-0} -PUSH_BRANCHES=`echo \ +PUSH_BRANCHES=$(echo \ master \ {release,maint}-0.4.1 \ {release,maint}-0.4.0 \ {release,maint}-0.3.5 \ {release,maint}-0.2.9 \ - ` + ) if [ "$PUSH_DELAY" -le 0 ]; then echo "Pushing $PUSH_BRANCHES" + # We know that there are no spaces in any branch within $PUSH_BRANCHES, so + # it is safe to use it unquoted. (This also applies to the other shellcheck + # exceptions below.) + # + # shellcheck disable=SC2086 git push --atomic "$@" "$UPSTREAM_REMOTE" $PUSH_BRANCHES else - PUSH_BRANCHES=`echo "$PUSH_BRANCHES" | tr " " "\n" | sort -V` - MASTER_BRANCH=`echo "$PUSH_BRANCHES" | tr " " "\n" | grep master` - MAINT_BRANCHES=`echo "$PUSH_BRANCHES" | tr " " "\n" | grep maint` - RELEASE_BRANCHES=`echo "$PUSH_BRANCHES" | tr " " "\n" | grep release | \ - tr "\n" " "` + PUSH_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | sort -V) + MASTER_BRANCH=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep master) + MAINT_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep maint) + RELEASE_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep release | \ + tr "\n" " ") printf "Pushing with %ss delays, so CI runs in this order:\n%s\n%s\n%s\n" \ "$PUSH_DELAY" "$MASTER_BRANCH" "$MAINT_BRANCHES" "$RELEASE_BRANCHES" - git push "$@" "$UPSTREAM_REMOTE" $MASTER_BRANCH + git push "$@" "$UPSTREAM_REMOTE" "$MASTER_BRANCH" sleep "$PUSH_DELAY" + # shellcheck disable=SC2086 for b in $MAINT_BRANCHES; do git push "$@" "$UPSTREAM_REMOTE" $b sleep "$PUSH_DELAY" done + # shellcheck disable=SC2086 git push --atomic "$@" "$UPSTREAM_REMOTE" $RELEASE_BRANCHES fi |