-
Notifications
You must be signed in to change notification settings - Fork 25
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
Histogram diff #289
Histogram diff #289
Conversation
Are any of the community crates sufficiently low-dep and worth using? https://crates.io/crates/imara-diff or https://crates.io/crates/diff-match-patch-rs or https://crates.io/crates/diff ? |
Ah yes, I didn't think that was an option. But indeed imara-diff has just two dependencies: ahash and hashbrown. It is probably the fastest diff library out there. |
std-only is certainly the preference. However, low-dep and no-dep algorithm crates that avoid our reinventing the wheel are OK as an exception. We want to avoid "heavy" deps such as serde, nix, rustix, tokio etc. (alas, still working on that...). And avoid low-quality, incomplete crates. |
Ok so the default diff, unified diff and edit_script are working fine. I think the implementation is quite performant. Just tested by cloning helix in two different dirs, checking out for one of them to 22.08.1 and doing I just need to finish updating |
Ready for review I believe. |
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.
LGTM
post-merge warning added to build:
also, increasing the speed of diff tests would be nice; they are the slowest tests in posixutils. |
Opened a PR to fix the issue with Change enum. |
#225
Implements histogram diff. I had to change quite a bit how the diff is printed because I believe having to annotate each line of the files with
Change::{Unchanged, Deleted, Inserted}
etc was not optimal. We just need to know where the hunks start and end.Todo:
print_context()
print_edit_script()
create_hunks_from_lcs()
Nice to have
ChangeData
struct at all in the end.