Skip to content

Commit a142f97

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8c5e43 commit a142f97

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

range-diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ static int read_patches(const char *range, struct string_list *list)
8585
strbuf_addbuf(&buf, &line);
8686
strbuf_addstr(&buf, "\n\n");
8787
} else if (starts_with(line.buf, " ")) {
88+
strbuf_rtrim(&line);
8889
strbuf_addbuf(&buf, &line);
8990
strbuf_addch(&buf, '\n');
9091
}

0 commit comments

Comments
 (0)