diff options
author | Daniel Smith <daniel.smith@qt.io> | 2023-07-10 12:55:08 +0200 |
---|---|---|
committer | Daniel Smith <Daniel.Smith@qt.io> | 2023-07-21 06:30:24 +0000 |
commit | 9c5662202d21ed5b472e0bac80fd0a734ee0480e (patch) | |
tree | 3934d4c01c8fdcf4eb10e85f633259bdfdf28b10 /git-hooks | |
parent | ea67c51fc06fd77e2a133ecffa54cede1bd78c8c (diff) |
Handle branch prefixes for pick targets
The sanity bot does not presently handle Pick-to: branch targets
when the branch contains a prefix. Since Pick-to: targets are always
bare, we should test for the branch including allowed prefixes.
Public LTS branches are prefixed with "lts-".
TQtC private branches are prefixed with "tqtc/lts-".
Change-Id: I31fba92bf39fc92e06f0bf8e0c93ef6874151935
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-x | git-hooks/sanitize-commit | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit index 715956d..8735e15 100755 --- a/git-hooks/sanitize-commit +++ b/git-hooks/sanitize-commit @@ -513,7 +513,15 @@ while (<MSG>) { } elsif (/^Pick-to: *(.*)/i) { for my $pick (split(/\s+/, $1)) { $picktos{$pick} = 1; - if (!defined($allHeads{$pick})) { + my @pick_alternatives = ($pick, "lts-$pick", "tqtc/lts-$pick"); + my $valid_pick = 0; + foreach my $pick_alt (@pick_alternatives) { + if (defined($allHeads{$pick_alt})) { + $valid_pick = 1; + last; + } + } + if (!$valid_pick) { complain_ln("Pick-to entry '$pick' is not a valid branch in $repo", "pickto", 1); } elsif (defined($target) && ($pick eq $target)) { |