sendemail.maximumDiffSize: Limit the size of diffs sent by email

If a unified diff included in an email will exceed the limit
configured by the system administrator, only the affected file
paths are listed in the email instead. This gives interested parties
some context on the size and scope of the change, without killing
their inbox.

Change-Id: I93c6068e9fd04095b6ad353b736126b29c4ed4fc
This commit is contained in:
Shawn O. Pearce
2012-06-12 14:36:34 -07:00
parent 390eff94c9
commit 28a950b75f
3 changed files with 49 additions and 35 deletions

View File

@@ -23,9 +23,11 @@ import org.eclipse.jgit.lib.Config;
@Singleton
class EmailSettings {
final boolean includeDiff;
final int maximumDiffSize;
@Inject
EmailSettings(@GerritServerConfig Config cfg) {
includeDiff = cfg.getBoolean("sendemail", "includeDiff", false);
maximumDiffSize = cfg.getInt("sendemail", "maximumDiffSize", 256 << 10);
}
}