summaryrefslogtreecommitdiffstats
path: root/git-hooks/gerrit-bot
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-23 14:30:16 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-23 14:05:45 +0000
commit3564f7cbbf073db127d843b80944fbdb74f9749e (patch)
tree0f4850b6569564f079b99897cf60efdcb7b584e4 /git-hooks/gerrit-bot
parentf1350614f50beccab224c4a65580a4edb6f0a637 (diff)
invite reviewers before posting review
it sort of makes sense that the persons actually see why they are being invited. Change-Id: Ie6cf006fc2e137d439924774ff0808cda8c42626 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Diffstat (limited to 'git-hooks/gerrit-bot')
-rwxr-xr-xgit-hooks/gerrit-bot16
1 files changed, 8 insertions, 8 deletions
diff --git a/git-hooks/gerrit-bot b/git-hooks/gerrit-bot
index db2aac3..522f5d2 100755
--- a/git-hooks/gerrit-bot
+++ b/git-hooks/gerrit-bot
@@ -245,6 +245,14 @@ sub process_commit($$$$$)
}
}
}
+ if (@invite) {
+ if (system(@gerrit, "set-reviewers", (map { ('-a', $_) } @invite), '--', $rev)) {
+ print "===== ".strftime("%c", localtime(time()))." ===== invitation FAILED\n";
+ printerr("Inviting reviewers to ".$rev." (".$project."/".$ref.") failed");
+ } else {
+ $verbose and print "Invited @invite to ".$rev." (".$project."/".$ref.")\n";
+ }
+ }
if ($use_rest) {
if (defined($$verdict{message}) || length($message)) {
$$verdict{message} = $message.($$verdict{message} || "");
@@ -276,14 +284,6 @@ sub process_commit($$$$$)
}
}
$verbose and print "Submitted verdict for ".$rev." (".$project."/".$ref."): $score\n";
- if (@invite) {
- if (system(@gerrit, "set-reviewers", (map { ('-a', $_) } @invite), '--', $rev)) {
- print "===== ".strftime("%c", localtime(time()))." ===== invitation FAILED\n";
- printerr("Inviting reviewers to ".$rev." (".$project."/".$ref.") failed");
- return;
- }
- $verbose and print "Invited @invite to ".$rev." (".$project."/".$ref.")\n";
- }
}
$| = 1; # make STDOUT autoflush