-
Notifications
You must be signed in to change notification settings - Fork 703
conflicts: allow missing newlines at end of file (based on previous content) #5186
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
conflicts: allow missing newlines at end of file (based on previous content) #5186
Conversation
One possible issue with this approach is that some conflicts become unreadable. For instance, a conflict with a base of
|
I think |
f900119
to
6a87871
Compare
Ok, I updated it so that it would render as this:
|
d5ea5ea
to
e0ee931
Compare
e0ee931
to
9a636e0
Compare
9a636e0
to
f1bedc4
Compare
f1bedc4
to
1f22232
Compare
I'll mark this as ready for review since there hasn't been any more discussion, and I think this is the simplest solution. |
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.
Looks good to me, thanks!
1f22232
to
3f805a7
Compare
File conflicts have been simplified during materialization since 0.19.0, so it should be safe to remove support for unsimplified conflicts now. This will make implementing the next commit easier, since it won't have to support unsimplified conflicts.
A missing newline would cause the following conflict markers to become invalid when materializing the conflict, so we add a newline to prevent this from happening. When parsing, if we parsed a conflict at the end of the file which ended in a newline, we can check whether the file actually did end in a newline, and then remove the newline if it didn't.
This isn't strictly necessary since it doesn't affect parsing, but it should make it more understandable for the user.
3f805a7
to
34ba794
Compare
Fixes #3968. Alternative to #5181 and #4088.
Checklist
If applicable:
CHANGELOG.md