Use "warning" prefix to allow colorization of remote output
Since commit bf1a11f "sideband: highlight keywords in remote sideband
output" [1] in git, the "warning" keyword will be highlighted in the
remote output when color.remote is enabled in the git config.
Change "(W)" to "warning" to make use of this feature.
Also make the messages a bit less verbose by removing "commit".
[1] https://github.com/git/git/commit/bf1a11f0a100b080a25233980c14b5ae8f3a7d2d
Change-Id: I9d337af70fc12ddea356d361da23ce8f0bfa85a2
diff --git a/src/main/java/com/googlesource/gerrit/plugins/validators/CommitMessageLengthValidation.java b/src/main/java/com/googlesource/gerrit/plugins/validators/CommitMessageLengthValidation.java
index 7981e18..7b0ee4e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/validators/CommitMessageLengthValidation.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/validators/CommitMessageLengthValidation.java
@@ -73,7 +73,7 @@
messagesList.add(new CommitValidationMessage(message, true));
throw new CommitValidationException("Commit length validation failed", messagesList);
}
- messagesList.add(new CommitValidationMessage("(W) " + message, false));
+ messagesList.add(new CommitValidationMessage("warning: " + message, false));
}
@Override
@@ -87,7 +87,7 @@
onLineTooLong(
id,
messages,
- "commit subject >" + this.maxSubjectLength + " characters; use shorter first paragraph");
+ "subject >" + this.maxSubjectLength + " characters; use shorter first paragraph");
}
int longLineCnt = 0;
@@ -105,7 +105,7 @@
onLineTooLong(
id,
messages,
- "too many commit message lines longer than "
+ "too many message lines longer than "
+ this.maxLineLength
+ " characters; manually wrap lines");
}