-
Notifications
You must be signed in to change notification settings - Fork 698
Don't strip trailing newlines but keep them in the diff. #10404
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
base: master
Are you sure you want to change the base?
Conversation
@Byron is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
With this fix, newlines are relevant in diffs. Screen.Recording.2025-09-22.at.14.50.59.movThey could benefit from special rendering in the frontend as well. It's unclear if there are corner-cases on Windows that were bypassed previously, maybe stripping newlines was never necessary though or it stopped being necessary over time due to improvements in other places. CC @krlvi as this might need some testing on Windows. We don't seem to have a breaking test though so but I am not sure they cover everything. |
Here is my comment from Discord for a second life: Can we fix the 'line change diff shows up empty' issue in post 😅? This picture would have to be changed to something else, to buy time until we can tackle the actual problem properly. ![]() |
Ok, if it's a deep rabbit hole then let's try and manage this in the front end. I won't be able to get to this in the next few days, but I can try and make it so if there are no flags changes, and the file is modified, then we switch the message to something about newlines. |
Thank you, appreciated! |
This *should* work as we transform to a normalised form before diffing. However, I think the reason for the change ultimately was Windows, where crlf/lf differences might make diffs light up unnecessarily. Maybe there will be more polish in that regard. Unfortunately it's also not clear anymore why stripping was deemed so very necessary in the first place.
This should work as we transform to a normalised form before diffing. However, I think the reason for the change ultimately was Windows, where crlf/lf differences might make diffs light up unnecessarily.
Maybe there will be more polish in that regard. Unfortunately it's also not clear anymore why stripping was deemed so very necessary in the first place.
Tasks
Future Tasks