git differences: consider renamed files
Hey.
Not sure if that would even be possible, but meld is used with git
(e.g. git difftool -d
) and when a file is renamed there (git mv
) optionally, with further changes in the file... then git tries to determine such renamed files and also output that in e.g. git diff
like so:
$ 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
(not the similarity index 80%
).
Right now, meld
shows such a rename as deleted file on the left side and added on the right side (actually both in green colour,... whereas I think on the left side it should be red?).
It would be cool if meld
could realise that and indicate that the files are renamed, perhaps with another colour (orange?).
If it's not just renamed, but also has changes in the content, the colour highlighting of the files could be orange/blue hatched (with the same blue that's used now for indicating changes)?
Also, right now such files are not displayed in the "same line".
I guess there would be several ways to improve that:
- If the renamed files are still in the same folder, an option could allow users to choose whether for one side the file is simply moved to another place, so that it's "right next" to its counterpart on the other side. Of course this would break the alphabetical ordering. When it's not configurable to choose which side would be "moved", it should IMO be the left one.
- If files are however in a different directory, the moving no longer works. In that case the following could be done: If the renamed file is selected on either side, there could be some line or so, that connects it on both sides, so that one can - if desired - easily find its counterpart.
Oh and last but not least... unless that can be somehow read from the git config (and beware, that reading the git config may allow for remote code execution attacks, when embedded bare repos are considerd), it would be nice if one could set a threshold for the similarity index.
Thanks, Chris.