From a2ebc6aedfc217e2af4b02ae97c7a598e85daff9 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Fri, 4 Sep 2020 10:51:28 +0200 Subject: Sanity-bot: Make sure Pick-to footer doesn't contain source branch The sanity bot should warn if the source branch is in the Pick-to footer since this would be redundant and cause a failed pick attempt by the cherry-pick bot. Only exact branches are matched, since it is possible to submit a change to a minor branch with a Pick-to footer that targets a bugfix branch. Fixes: QTQAINFRA-3886 Change-Id: I234d20205bd3896b7be631ba29db2efe895b9bd3 Reviewed-by: Oswald Buddenhagen --- git-hooks/sanitize-commit | 3 +++ 1 file changed, 3 insertions(+) (limited to 'git-hooks') diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit index b38359d..a9cdc13 100755 --- a/git-hooks/sanitize-commit +++ b/git-hooks/sanitize-commit @@ -505,6 +505,9 @@ while () { if (!defined($allHeads{$pick})) { complain_ln("Pick-to entry '$pick' is not a valid branch in $repo", "pickto", 1); + } elsif ($pick eq $branch) { + complain_ln("Pick-to entry ${pick} equals source branch '${$branch}'", + "pickto", 1) } } complain_ln("Capitalization of \"Pick-to\" is wrong", "") if (!/^Pick-to:/); -- cgit v1.2.3