summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2018-07-25 10:28:16 +0200
committerDavid Pursehouse <dpursehouse@collab.net>2019-02-04 08:57:10 +0900
commit25aee8f0bf0bb03ab0be82263a3542907d49c7b0 (patch)
treed225022433d3f537fba0a9d688e4422a25a952cb
parentf61bc3f4f7e732742083868e93cd2ffae970be4e (diff)
Always end the "Change-Id missing" error message with \n.
This should fix the current output which looks like remote: ERROR: [5bfebfb] missing .. footerHint: to automatically .. Change-Id: Id555b98cccdc25faf2faf641f564692ced10e35d
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java
index a71317f54b..ccc5461f77 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java
@@ -288,14 +288,14 @@ public class CommitValidators {
private CommitValidationMessage getMissingChangeIdErrorMsg(String errMsg, RevCommit c) {
StringBuilder sb = new StringBuilder();
- sb.append("ERROR: ").append(errMsg);
+ sb.append("ERROR: ").append(errMsg).append("\n");
boolean hinted = false;
if (c.getFullMessage().contains(CHANGE_ID_PREFIX)) {
String lastLine = Iterables.getLast(Splitter.on('\n').split(c.getFullMessage()), "");
if (!lastLine.contains(CHANGE_ID_PREFIX)) {
hinted = true;
- sb.append("\n\n")
+ sb.append("\n")
.append("Hint: run\n")
.append(" git commit --amend\n")
.append("and move 'Change-Id: Ixxx..' to the bottom on a separate line\n");
@@ -304,7 +304,7 @@ public class CommitValidators {
// Print only one hint to avoid overwhelming the user.
if (!hinted) {
- sb.append("Hint: to automatically insert a Change-Id, install the hook:\n")
+ sb.append("\nHint: to automatically insert a Change-Id, install the hook:\n")
.append(getCommitMessageHookInstallationHint())
.append("\n")
.append("and then amend the commit:\n")