From bff6da25e7168c11cf96e1e4f1fdd2331aed9d5b Mon Sep 17 00:00:00 2001 From: Elod Illes Date: Fri, 12 Jul 2024 23:10:26 +0200 Subject: [PATCH] [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 e2697de8e41a566eb86aefa364906bda9bc59863) (cherry picked from commit 602e68364c54fb54140006f38d6995b9a5b354a9) (cherry picked from commit 56e73cc7bad51435a79584e9411f07add0d0536a) (cherry picked from commit f53824f95bea8769a2b28c62f23e57cb8dbafae5) (cherry picked from commit f43ceef5769f1bfbeddf062f3fd745fc3c519ace) (cherry picked from commit 7b7bac3e21a64bea33527a8aedf12f5db8a3dea0) (cherry picked from commit 7cef0d340fa18601eef2475e697f7d936955ee8b) --- tools/check-cherry-picks.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/check-cherry-picks.sh b/tools/check-cherry-picks.sh index e985d871daf..820f32aa428 100755 --- a/tools/check-cherry-picks.sh +++ b/tools/check-cherry-picks.sh @@ -1,7 +1,8 @@ #!/bin/sh # # A tool to check the cherry-pick hashes from the current git commit message -# to verify that they're all on either master or stable/ branches +# to verify that they're all on either master, stable/ or unmaintained/ +# branches # commit_hash="" @@ -18,9 +19,9 @@ hashes=$(git show --format='%b' --quiet $commit_hash | sed -nr 's/^.cherry picke checked=0 branches+="" for hash in $hashes; do - branch=$(git branch -a --contains "$hash" 2>/dev/null| grep -oE '(master|stable/[a-z0-9.]+)') + branch=$(git branch -a --contains "$hash" 2>/dev/null| grep -oE '(master|stable/[a-z0-9.]+|unmaintained/[a-z0-9.]+)') if [ $? -ne 0 ]; then - echo "Cherry pick hash $hash not on any master or stable branches" + echo "Cherry pick hash $hash not on any master, stable or unmaintained branches" exit 1 fi branches+=" $branch" @@ -28,7 +29,7 @@ for hash in $hashes; do done if [ $checked -eq 0 ]; then - if ! grep -q '^defaultbranch=stable/' .gitreview; then + if ! grep -qE '^defaultbranch=(stable|unmaintained)/' .gitreview; then echo "Checked $checked cherry-pick hashes: OK" exit 0 else