-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix the line ending issue #11
Conversation
Extra new lines are now gone but the script still seems to unnecessarily change the line endings making Git to believe that every line in |
Actually, I'm not sure what happens there. The line endings are correct CRLF before and after running
for the entire |
Is this due to some Git config issue? I noticed that the commit editor that gets launched when I run |
Okay, what fixes the problem is to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newlines seem to be working after adding .gitattributes
to the Toolbox repos.
Unfortunately, I still see the problem even after I thought |
Strange, I do not see any newline issues anymore on my system. |
I take back what I said about not having newline issues. There is something fishy still. |
Could you tell me how this is configured? Is it whatever is returned by:
What is the value of the above command for you?
This is a bit difficult to answer. We are using the Git repo from Python using I'll look at the line-ending issues a bit later, I'm working on a different project today. |
So this is notepad++ as it should be and not notepad.
Sure, this is not top priority by any means. |
Linux/MacOs uses LF line-endings, whereas Windows uses CRLF. Since some commands rewrite files while preserving line-endings, we need a consistent environment for testing on all platforms. So disable the autocrlf behaviour of Git on Windows.
- respect git config core.editor - parse EDITOR correctly with shlex (e.g. paths w/ spaces) - find fallback editors per-platform
when adding files on Windows, sometimes it was changing line-endings. This was because GitPython doesn't respect autocrlf (unfortunately this is a WONTFIX upstream, see gitpython-developers/GitPython#1441). Workaround: use git directly
Fixes #9
@soininen @PekkaSavolainen could you please check?