On Friday, January 23, 2015 at 10:15:10 AM UTC+1, Edwin Kempin wrote:
2015-01-23 10:05 GMT+01:00 Øyvind Harboe
<oyvind...@gmail.com>:
On Friday, January 23, 2015 at 9:57:52 AM UTC+1, Edwin Kempin wrote:
2015-01-22 19:01 GMT+01:00 Øyvind Harboe
<oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.
Am I correct in concluding from what you write that you think this is a good idea and that formulating a patch would make sense?
Yes, this would be a nice feature!
The change below to Gerrit 2.10 seems to have done the trick from my testing on my local setup. I'll test it out after we've upgraded to Gerrit 2.10.
I don't have a contributors agreement sorted out, so I can't upload it as a Gerrit review yet. I'm not sure what else there's to it. Is there any reason to send out emails upon a trivial rebase? If not, then a configuration option is an unnecessary complication.
git show -w 499e002e7375c2c5211b
commit 499e002e7375c2c5211b49e3871cef3deaa4bd6a
Author: Øyvind Harboe
Date: Wed Jan 28 21:07:30 2015 +0100
notification: no longer sends out email on notification on trivial rebase
Change-Id: I2726456c6e1e3b22274ad253de01578a6a9ebdb0
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCom
index cedf11a..8c034aa 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.ja
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.ja
@@ -2093,8 +2093,16 @@ public class ReceiveCommits {
.addChange(change)
.reindex()
.runAsync();
- workQueue.getDefaultQueue()
- .submit(requestScopePropagator.wrap(new Runnable() {
+
+ /* Reduce noise by not sending out emails about trivial rebases */
+ RevCommit priorCommit = revisions.inverse().get(priorPatchSet);
+ ChangeKind changeKind = changeKindCache.getChangeKind(
+ projectControl.getProjectState(), repo, priorCommit, newCommit);
+
+ if (changeKind != ChangeKind.TRIVIAL_REBASE)
+ {
+ workQueue.getDefaultQueue().submit(
+ requestScopePropagator.wrap(new Runnable() {
@Override
public void run() {
try {
@@ -2107,7 +2115,8 @@ public class ReceiveCommits {
cm.addExtraCC(recipients.getCcOnly());
cm.send();
} catch (Exception e) {
- log.error("Cannot send email for new patch set " + newPatchSet.getI
+ log.error("Cannot send email for new patch set "
+ + newPatchSet.getId(), e);
}
if (mergedIntoRef != null) {
sendMergedEmail(ReplaceRequest.this);
@@ -2119,6 +2128,7 @@ public class ReceiveCommits {
return "send-email newpatchset";
}
}));
+ }
f.checkedGet();