Overview
| Artifact ID: | 3e2ded84aca99033ee7ccdcc60f472ae3dfe7b32ddc01639205bd7cb65d0e127 |
|---|---|
| Page Name: | checkin/ea5f4d03ed66361cb6fa73cfb99f60ccaa3ea81e0f2add0828455c61e21a427c |
| Date: | 2026-11-28 17:00:45 |
| Original User: | dmestas |
| Mimetype: | text/x-markdown |
Content
When the last line of a file has no line end and one side of a merge adds
lines after it, the text merge used by fossil merge, update, stash and
3-way-merge joined the first added line to that last line:
| Content | |
|---|---|
| Ancestor | a\nb\nc |
| Ours | a\nB\nc |
| Theirs | a\nb\nc\nd |
| Merged before | a\nB\ncd |
| Merged now | a\nB\nc\nd |
The same happened when both sides added lines, and an added blank line was
lost (merging a with a\n\n gave a\n). Now the merge ends the last line
before adding lines after it, using the line end it uses for conflict marks.
Inputs that already end in a line end merge as before.
Tested with 3-way-merge and with fossil merge in a real checkout;
the tests are blob-merge-no-final-newline-append, -append-local and
-append-both in test/blob.test. Not run on Windows.