aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2017-10-16 15:19:27 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-10-16 17:49:05 +0200
commitb62f717cbad93a1204a77f7179aaf663037fbfce (patch)
tree98d3c9dd5862896637af92986a11acc0a560980f /scripts
parent384871626bbec1eac32091e29e9230f849790877 (diff)
Release notes test small fixes
- Avoid trap being called when grep is not matching (|| true) - Ensure we always start in master branch Change-Id: I7a71abbdfae7dc2b9680e769ed0322a6a12221dc PiperOrigin-RevId: 172316454
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/release/relnotes.sh4
-rwxr-xr-xscripts/release/relnotes_test.sh1
2 files changed, 3 insertions, 2 deletions
diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh
index 1f2493bf34..e72d3d42e8 100755
--- a/scripts/release/relnotes.sh
+++ b/scripts/release/relnotes.sh
@@ -61,12 +61,12 @@ function get_release_notes_commits() {
shift
local cherry_picks="$@"
local rollback_commits=$(git log --oneline -E --grep='^Rollback of commit [a-z0-9]+.$' ${baseline}.. \
- | grep -E '^[a-z0-9]+ Rollback of commit [a-z0-9]+.$')
+ | grep -E '^[a-z0-9]+ Rollback of commit [a-z0-9]+.$' || true)
local rollback_hashes=$(echo "$rollback_commits" | cut -d " " -f 1)
local rolledback_hashes=$(echo "$rollback_commits" | cut -d " " -f 5 | sed -E 's/^(.......).*$/\1/')
local exclude_hashes=$(echo $cherry_picks $rollback_hashes $rolledback_hashes | xargs echo | sed 's/ /|/g')
git log --reverse --pretty=format:%H ${baseline}.. -E --grep='^RELNOTES(\[[^\]+\])?:' \
- | grep -Ev "^(${exclude_hashes})"
+ | grep -Ev "^(${exclude_hashes})" || true
}
# Extract the release note from a commit hash ($1). It extracts
diff --git a/scripts/release/relnotes_test.sh b/scripts/release/relnotes_test.sh
index 0cf42b46ab..a3c8cebf6e 100755
--- a/scripts/release/relnotes_test.sh
+++ b/scripts/release/relnotes_test.sh
@@ -31,6 +31,7 @@ source ${SCRIPT_DIR}/relnotes.sh || { echo "relnotes.sh not found!" >&2; exit 1;
function set_up() {
cd ${MASTER_ROOT}
+ git checkout -q master
}
function test_format_release_notes() {