Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-08-13 14:33:08 +0300
committerJunio C Hamano <gitster@pobox.com>2018-08-13 20:44:51 +0300
commita142f978e7fbf7f4cbacb19c2475fbb82c29e5ca (patch)
tree3b1308919fa81ab9370609fcd39dff77639561e7 /range-diff.c
parentc8c5e43ac3f9a5b785faf16f10bb8e2c493606a4 (diff)
range-diff: right-trim commit messages
When comparing commit messages, we need to keep in mind that they are indented by four spaces. That is, empty lines are no longer empty, but have "trailing whitespace". When displaying them in color, that results in those nagging red lines. Let's just right-trim the lines in the commit message, it's not like trailing white-space in the commit messages are important enough to care about in `git range-diff`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/range-diff.c b/range-diff.c
index 71883a4b7d..1ecee2c09c 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -85,6 +85,7 @@ static int read_patches(const char *range, struct string_list *list)
strbuf_addbuf(&buf, &line);
strbuf_addstr(&buf, "\n\n");
} else if (starts_with(line.buf, " ")) {
+ strbuf_rtrim(&line);
strbuf_addbuf(&buf, &line);
strbuf_addch(&buf, '\n');
}