Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing of EOL produces incorrect patch #50

Open
andrewshadura opened this issue Jul 5, 2023 · 1 comment
Open

Removing of EOL produces incorrect patch #50

andrewshadura opened this issue Jul 5, 2023 · 1 comment

Comments

@andrewshadura
Copy link
Owner

Prepare a test repo:

git init
echo test > test
git add test
git commit -m test
echo -n test > test

This produces a diff:

diff --git a/test b/test
index 9daeafb9864c..30d74d258442 100644
--- a/test
+++ b/test
@@ -1 +1 @@
-test
+test
\ No newline at end of file

This is being parsed as:

diff --git a/test b/test
index 9daeafb9864c..30d74d258442 100644
--- a/test
+++ b/test
@@ -1,1 +1,1 @@
-test
\ No newline at end of file
+test
@rwarren
Copy link

rwarren commented Aug 2, 2023

Just going to add a note here since this is still a major problem for me. I had a failed PR (#48) for this, but I unfortunately don't understand enough about the patch processing to implement a proper fix.

FWIW, this is a particular problem when working with Visual Studio (full VS, not vscode) since it saves a bunch of its managed files (packages.config, *.resx, *.Dotsettings, etc) without newlines at the end. 😭 This is obviously an edge case for any git-crecord users out there since it doesn't run on Windows (I use it through WSL), but it is a huge pain for me, unfortunately.

I really miss mercurial some days.

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

No branches or pull requests

2 participants