Skip to content

Commit fe0eb7a

Browse files
author
Elod Illes
committed
[tools] Ignore bot generated patches
This is a fix for the test whether a patch is bot generated or not, as that did not worked as intended. The problem is that the script is checking the email address of the parent patch (HEAD~), which probably should be right in case the patch would be a MERGE patch. But this is wrong in case the patch is not a MERGE patch. This fix uses the very same pattern as it is using for the commit message parsing: the $commit_hash variable, which is the parent's commit hash if the patch is a MERGE patch, and an empty string in the other case (causing to call 'git show' on HEAD). Change-Id: I0abc72180edf34a6dd0624a40fb8682397805eca (cherry picked from commit b8f3975) (cherry picked from commit 92b781f) (cherry picked from commit 7a914d6) (cherry picked from commit 8b79f0f)
1 parent 5ba1bd1 commit fe0eb7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/check-cherry-picks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ $parent_number -eq 2 ]; then
1414
commit_hash=$(git show --format='%P' --quiet | awk '{print $NF}')
1515
fi
1616

17-
if git show --format='%aE' HEAD~ --quiet | grep -qi 'infra-root@openstack.org'; then
17+
if git show --format='%aE' --quiet $commit_hash | grep -qi 'infra-root@openstack.org'; then
1818
echo 'Bot generated change; ignoring'
1919
exit 0
2020
fi

0 commit comments

Comments
 (0)