feature/end-of-sequence #3

Merged
maximilianbarg merged 4 commits from feature/end-of-sequence into main 2026-09-27 16:35:31 +00:00
No description provided.
The unconditional removesuffix in to_git, to_git_extended and
to_structured dropped a trailing newline even when the input
documents ended with one. Units now carries an ends_with_newline
flag (set from the parsed string, inherited from ours/theirs in
_merge_units since the base never counts as a version) and the
renderers only strip the final newline when it is False.

Also fixes to_json_lines crashing with KeyError when the last unit
is a conflict unit and with IndexError on an empty document.
docs: document newline handling decision
All checks were successful
Tests / test (3.11) (pull_request) Successful in 3s
Tests / test (3.13) (pull_request) Successful in 3s
Tests / test (3.12) (pull_request) Successful in 3s
Tests / test (3.14) (pull_request) Successful in 3s
3831664723
Add docs/newline-handling.md explaining the architectural decision:
lines are normalized at parse time (a trailing newline is appended so
difflib line identity and conflict block output stay well-formed) and
the original trailing-newline state is carried in
Units.ends_with_newline, applied by the to_* renderers. Link the doc
from the README and add docs/ to the project layout in README and
AGENTS.md.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
maximilianbarg/n-way-merge!3
No description provided.