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

git icdiff shows old filname for renamed files #203

Open
calestyo opened this issue Nov 16, 2022 · 2 comments
Open

git icdiff shows old filname for renamed files #203

calestyo opened this issue Nov 16, 2022 · 2 comments

Comments

@calestyo
Copy link

Hey.

When doing git icdiff on a renamed file that has changes, it does actually show only the differences between the old and new file.

But on the right hand side, it again uses the old filename, though that has also changed.

Thanks,
Chris.

@jeffkaufman
Copy link
Owner

Trying to reproduce, I think git diff does the same thing?

I think it's happening because your rename has already been staged, and so diffing just shows you the differences relative to what's staged.

@calestyo
Copy link
Author

calestyo commented Nov 17, 2022

Hey.

I think it must be staged, because the git mv stages that already, so the changes need to be staged as well.

I just tried it with a normal git diff, but that seems to show the rename:

$ git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	renamed:    bla -> foo
$ git diff --staged
diff --git a/bla b/foo
similarity index 80%
rename from bla
rename to foo
index 9405325..e006065 100644
--- a/bla
+++ b/foo
@@ -1,5 +1,4 @@
 a
 b
-c
 d
 e
$ git icdiff --staged
bla                                                                                            bla                                                                                           
a                                                                                              a                                                                                             
b                                                                                              b                                                                                             
c                                                                                                                                                                                            
d                                                                                              d                                                                                             
e                                                                                              e                                                                                             

Thanks,
Chris.

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