diff options
author | Androbin <robin.richtsfeld@gmail.com> | 2017-11-29 01:31:47 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-11-29 01:33:24 -0800 |
commit | 9c78a79c02d38a98a38d852e10b16d8cb7a59c91 (patch) | |
tree | a9af77a8a9c2dc588705351d64941596bfc8b89f /scripts/release | |
parent | ff62e1d0edf65d5103dde914db780f9c10371b92 (diff) |
Various Shell Script Fixes and Improvements - Part One
see #4023
Closes #4051.
PiperOrigin-RevId: 177279457
Diffstat (limited to 'scripts/release')
-rwxr-xr-x | scripts/release/release.sh | 16 | ||||
-rwxr-xr-x | scripts/release/relnotes.sh | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/scripts/release/release.sh b/scripts/release/release.sh index 6a2559adc7..3b18fd80c2 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -122,11 +122,11 @@ function create_release_commit() { function apply_cherry_picks() { echo "Applying cherry-picks" # Apply cherry-picks - for i in $@; do + for commit in "$@"; do local previous_head="$(git rev-parse HEAD)" - echo " Cherry-picking $i" - git cherry-pick $i >/dev/null || { - echo "Failed to cherry-pick $i. please resolve the conflict and exit." >&2 + echo " Cherry-picking ${commit}" + git cherry-pick ${commit} >/dev/null || { + echo "Failed to cherry-pick ${commit}. please resolve the conflict and exit." >&2 echo " Use 'git cherry-pick --abort; exit' to abort the cherry-picks." >&2 echo " Use 'git cherry-pick --continue; exit' to resolve the conflict." >&2 bash @@ -137,7 +137,7 @@ function apply_cherry_picks() { } # Add the origin of the cherry-pick in case the patch-id diverge and we cannot # find the original commit. - git notes --ref=cherrypick add -f -m "$i" + git notes --ref=cherrypick add -f -m "${commit}" done return 0 } @@ -147,9 +147,9 @@ function find_last_release() { local branch="${1:-HEAD}" local baseline="${2:-$(get_release_baseline "${branch}")}" local changes="$(git log --pretty=format:%H "${baseline}~".."${branch}")" - for i in ${changes}; do - if git notes --ref=release show $i &>/dev/null; then - echo $i + for change in ${changes}; do + if git notes --ref=release show ${change} &>/dev/null; then + echo ${change} return 0 fi done diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh index 94edb04c2c..d88ef46a2f 100755 --- a/scripts/release/relnotes.sh +++ b/scripts/release/relnotes.sh @@ -100,8 +100,8 @@ function generate_release_notes() { for i in "${RELNOTES_TYPES[@]}"; do eval "RELNOTES_${i}=()" done - for i in $@; do - extract_release_note $i + for commit in $@; do + extract_release_note "${commit}" done } |