Skip to content

Commit bff6da2

Browse files
author
Elod Illes
committed
[tools] Backport validator: handle unmaintained
When the script was created there were only stable/* branches, but now there are unmaintained/* branches as well, where the validator fails when looking for hashes only on stable/* branches even if the given hash is already on unmtaintained/* branch. This patch matches now both stable/* and unmaintained/* branches. Change-Id: I08fcc63ab0fbe5af1be70d5fde5af98bf006101c (cherry picked from commit e2697de) (cherry picked from commit 602e683) (cherry picked from commit 56e73cc) (cherry picked from commit f53824f) (cherry picked from commit f43ceef) (cherry picked from commit 7b7bac3) (cherry picked from commit 7cef0d3)
1 parent d3efd18 commit bff6da2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/check-cherry-picks.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22
#
33
# A tool to check the cherry-pick hashes from the current git commit message
4-
# to verify that they're all on either master or stable/ branches
4+
# to verify that they're all on either master, stable/ or unmaintained/
5+
# branches
56
#
67

78
commit_hash=""
@@ -18,17 +19,17 @@ hashes=$(git show --format='%b' --quiet $commit_hash | sed -nr 's/^.cherry picke
1819
checked=0
1920
branches+=""
2021
for hash in $hashes; do
21-
branch=$(git branch -a --contains "$hash" 2>/dev/null| grep -oE '(master|stable/[a-z0-9.]+)')
22+
branch=$(git branch -a --contains "$hash" 2>/dev/null| grep -oE '(master|stable/[a-z0-9.]+|unmaintained/[a-z0-9.]+)')
2223
if [ $? -ne 0 ]; then
23-
echo "Cherry pick hash $hash not on any master or stable branches"
24+
echo "Cherry pick hash $hash not on any master, stable or unmaintained branches"
2425
exit 1
2526
fi
2627
branches+=" $branch"
2728
checked=$(($checked + 1))
2829
done
2930

3031
if [ $checked -eq 0 ]; then
31-
if ! grep -q '^defaultbranch=stable/' .gitreview; then
32+
if ! grep -qE '^defaultbranch=(stable|unmaintained)/' .gitreview; then
3233
echo "Checked $checked cherry-pick hashes: OK"
3334
exit 0
3435
else

0 commit comments

Comments
 (0)