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

Doesn't support file name diff #102

Closed
stevemao opened this issue Feb 25, 2020 · 2 comments
Closed

Doesn't support file name diff #102

stevemao opened this issue Feb 25, 2020 · 2 comments

Comments

@stevemao
Copy link

stevemao commented Feb 25, 2020

$ git diff --staged

renamed: docker-compose.yaml ⟶   docker-compose.yaml2
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

renamed: docker-compose.yaml ⟶   docker-compose.yaml2
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

It should display once and highlight the diffs

@dandavison
Copy link
Owner

Thanks for this @stevemao, and sorry I didn't respond until now. I see that this is still a problem. It looks like delta does highlight now, but that we are still outputting the renamed line twice.

Example input is

diff --git a/src/edits.rs b/src/edit-renamed.rs
similarity index 99%
rename from src/edits.rs
rename to src/edit-renamed.rs
index 34ff14a..a92a606 100644
--- a/src/edits.rs
+++ b/src/edit-renamed.rs
@@ -5,6 +5,8 @@ use unicode_width::UnicodeWidthStr;
 
 use crate::align;
 
+/// line added here
+
 /// Infer the edit operations responsible for the differences between a collection of old and new
 /// lines. A "line" is a string. An annotated line is a Vec of (op, &str) pairs, where the &str
 /// slices are slices of the line, and their concatenation equals the line. Return the input minus

@dandavison
Copy link
Owner

And...sorry this took such a long time to fix. But it is fixed now!

(#245 was the same as this.)

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

No branches or pull requests

2 participants