Skip to content
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

diff: empty files are the same #578

Merged
merged 1 commit into from Apr 26, 2024
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Apr 25, 2024

  • Test case: "touch empty && perl diff empty empty"
  • Program seems to hang; ctrl-c in perl debugger hints that we are stuck in Algorithm::Diff::traverse_sequences()
  • Program grew to use >2GB of memory before I killed it
  • traverse_sequences() doesn't seem to handle when both lists of input lines are empty (I didn't bother investigating why)
  • Put a sanity check before diff()+traverse_sequences() are called; input files are read in total before diff() so the size of line list is know
  • I also tested a non-empty file against an empty one

* Test case: "touch empty && perl diff empty empty"
* Program seems to hang; ctrl-c in perl debugger hints that we are stuck in Algorithm::Diff::traverse_sequences()
* Program grew to use >2GB of memory before I killed it
* traverse_sequences() doesn't seem to handle when both lists of input lines are empty (I didn't bother investigating why)
* Put a sanity check before diff()+traverse_sequences() are called; input files are read in total before diff() so the size of line list is know
* I also tested a non-empty file against an empty one
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: diff The diff program labels Apr 25, 2024
@briandfoy briandfoy merged commit 235f16a into briandfoy:master Apr 26, 2024
2 checks passed
@briandfoy
Copy link
Owner

changes: empty files are the same

@briandfoy briandfoy self-assigned this Apr 26, 2024
@briandfoy briandfoy added Status: accepted The fix is accepted Status: released there is a new release with this fix and removed Priority: low get to this whenever Status: accepted The fix is accepted labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: diff The diff program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants