Skip to content

Conversation

gerhardol
Copy link
Member

@gerhardol gerhardol commented Sep 16, 2024

Part of #11831, that PR reports on the Git behavior to insert the information rather than the GE presentation.
I do not want to manipulate the git-diff output here, which is what is requested in #11831.

Proposed changes

Git may insert "\ No newline at end of file" in the end lines of a diff, this was not presented as Header unless last line.
(This printout may appear before last line in addition to the last line.)
Incorrect line numbers and not extra gray background.
Note that all printouts with '' as first chars could be handled this way, the first position is special (+/-/@ after the header).

Screenshots

See 1e1b946

Before

image

After

image

Test methodology

A test is added in an upcoming PR, some restructuring is done to tests and I prefer to wait on that.
(PR awaits #11851 and #11862).

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@mstv
Copy link
Member

mstv commented Sep 16, 2024

This handling should be applied to removed "\ No newline...", too.

E.g. 1e1b946

grafik

Git may insert "\ No newline at end of file" in the end lines of a diff,
this was not presented as Header unless last line.
@gerhardol gerhardol force-pushed the feature/i11831-no-newline-header branch from 3fab1b8 to 59b130e Compare September 16, 2024 20:28
@gerhardol
Copy link
Member Author

This handling should be applied to removed "\ No newline...", too.

That example was more than the 4 lines I assumed was reasonable, removed that limitation and use any line starting with
Also use your example in screenshots.

@gerhardol gerhardol merged commit 7b1cd3f into gitextensions:master Sep 17, 2024
4 checks passed
@gerhardol gerhardol deleted the feature/i11831-no-newline-header branch September 17, 2024 19:07
@RussKie RussKie added this to the 5.1 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants