Skip to content

Conversation

@sina-hide
Copy link
Contributor

When using CR/LF as newline on Windows, there were extra empty lines shown in diffs.

Commit b84b79 fixed a regression (#1996) by keeping CRs as content of diff lines instead of removing them. Additionally since commit 796f88 (#1543) the output for diffs uses the default newline depending on platform, that's CR/LF on Windows.

As consequence on Windows with files containing CR/LF as newlines the content (ending in CR) and the default newline CR/LF resulted in CR CR LF, which is interpreted as two line breaks instead of one.

So b84b79 introduced itself a regression that's fixed in this commit by partially reverting commit 796f88.

This fixes #2001.

When using CR/LF as newline on Windows, there were extra empty lines
shown in diffs.

Commit b84b79 fixed a regression (sourcegit-scm#1996) by keeping CRs as content of
diff lines instead of removing them.  Additionally since commit 796f88
(sourcegit-scm#1543) the output for diffs uses the default newline depending on
platform, that's CR/LF on Windows.

As consequence on Windows with files containing CR/LF as newlines the
content (ending in CR) and the default newline CR/LF resulted in CR CR
LF, which is interpreted as two line breaks instead of one.

So b84b79 introduced itself a regression that's fixed in this commit by
partially reverting commit 796f88.

This fixes sourcegit-scm#2001.
@love-linger love-linger self-assigned this Dec 29, 2025
@love-linger love-linger added the bug Something isn't working label Dec 29, 2025
@love-linger love-linger merged commit df3acff into sourcegit-scm:develop Dec 29, 2025
14 checks passed
@sina-hide sina-hide deleted the diff-extra-lines branch December 29, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants