Repository navigation
diff: write the ed script when a file lacks its final newline - #429
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
sorry but it needs to be rebased |
`diff -e` printed nothing but "No newline at end of file" when either file's last line had no newline. Like GNU diff, compare that line as if it had its newline, write the script, then warn about each such file on stderr and exit 2. Closes uutils#332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5d797b3 to
49fde05
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thanks for your PR |
Closes #332.
diff -eprinted only "No newline at end of file" when either file's last line had no newline, so a caller that applies or shows the script got nothing. GNU diff compares that last line as if it had its newline, writes the script, then warns on stderr (diff: FILE: No newline at end of file, then a blank line) for each such file and exits 2. This does the same, including with-q.ed_diff::diffcan no longer fail, so it now returns the script directly, and the fuzz target is updated to match. The new cases intests/by-util/test_diff.rsmatch the output of GNU diff 3.12 and fail without the change.This change was written with the help of an AI assistant (Claude); I reviewed and tested it.
🤖 Generated with Claude Code