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

Use similar rather than difflib to get better diffs #756

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

sourcefrog
Copy link
Contributor

Gives much better diffs when lines are inserted

Fixes #755

After:

   Replacing in NEWS.md
--- NEWS.md
+++ NEWS.md
@@ -2,6 +2,8 @@
 
 ## Unreleased
 
+## 24.2.1
+
 - New: `--features`, `--no-default-features` and `--all-features` options are passed through to Cargo.
 
 - Changed: Minimum Rust version (to build cargo-mutants, not to use it) increased to 1.73.

If this is OK in principal I can update all the other call sites that use difflib.

Cargo.toml Show resolved Hide resolved
src/ops/replace.rs Outdated Show resolved Hide resolved
@sourcefrog
Copy link
Contributor Author

Thanks, please take another look.

Incidentally did you mean for there to be two shell.rs with almost identical contents? I didn't need to change them for this but I just noticed it and wondered if it was due to an accident with git or something.

Gives much better diffs when lines are inserted

Fixes crate-ci#755
Extract a common function to make diffs
@sourcefrog
Copy link
Contributor Author

The cargo_deny failure (https://github.com/crate-ci/cargo-release/pull/756/checks) seems unrelated to this change

@epage epage merged commit 8812b27 into crate-ci:master Feb 27, 2024
14 of 15 checks passed
@sourcefrog sourcefrog deleted the similar-diff branch February 27, 2024 16:44
@epage
Copy link
Collaborator

epage commented Feb 27, 2024

Fixed shell.rs in a follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

diff is noisy if you insert new paragraphs into a changelog
2 participants