File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
#
3
3
# 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
5
6
#
6
7
7
8
commit_hash=" "
@@ -14,7 +15,7 @@ if [ $parent_number -eq 2 ]; then
14
15
commit_hash=$( git show --format=' %P' --quiet | awk ' {print $NF}' )
15
16
fi
16
17
17
- if git show --format=
' %aE' HEAD~ --quiet
| grep -qi
' [email protected] ' ; then
18
+ if git show --format=
' %aE' --quiet
$commit_hash | grep -qi
' [email protected] ' ; then
18
19
echo ' Bot generated change; ignoring'
19
20
exit 0
20
21
fi
@@ -23,17 +24,17 @@ hashes=$(git show --format='%b' --quiet $commit_hash | sed -nr 's/^.cherry picke
23
24
checked=0
24
25
branches+=" "
25
26
for hash in $hashes ; do
26
- branch=$( git branch -a --contains " $hash " 2> /dev/null| grep -oE ' (master|stable/[a-z0-9.]+)' )
27
+ branch=$( git branch -a --contains " $hash " 2> /dev/null| grep -oE ' (master|stable/[a-z0-9.]+|unmaintained/[a-z0-9.]+ )' )
27
28
if [ $? -ne 0 ]; then
28
- echo " Cherry pick hash $hash not on any master or stable branches"
29
+ echo " Cherry pick hash $hash not on any master, stable or unmaintained branches"
29
30
exit 1
30
31
fi
31
32
branches+=" $branch "
32
33
checked=$(( $checked + 1 ))
33
34
done
34
35
35
36
if [ $checked -eq 0 ]; then
36
- if ! grep -q ' ^defaultbranch=stable/' .gitreview; then
37
+ if ! grep -qE ' ^defaultbranch=( stable|unmaintained) /' .gitreview; then
37
38
echo " Checked $checked cherry-pick hashes: OK"
38
39
exit 0
39
40
else
You can’t perform that action at this time.
0 commit comments