Community
Participate
Working Groups
If I move a file from one place to the other it is automatically deleted/added by git to the staging view. But afterwards comparing do not work anymore the diff view always show it as a new file, this is especially annoying if one has moved the file and then change it to see what (beside the move) was modified. It would be great if EGit somewhere record the move and then creates a compare with the previous file.
See also the related bug 580240 in JGit. Similar problem. JGit has no rename detection between the working tree and HEAD, and apparently also not between the index and HEAD. Index to HEAD might perhaps be easier to implement. Basically before opening the diff, one would need to run a rename detection to determine the path in HEAD to compare against. That would cover the case when the addition is already staged. Doing the same for unstaged moves would require rename detection between the working tree and the index or HEAD. That's then the same problem as in bug 580240.
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/196898
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/196899
@Thomas Wolf I trust you in the technical part and conclusions, I sadly have no deeper knowledge about how (j)git works in regard to moved files, I just notices that afterwards egit seem to show that a file was moved, and also e.g. github tells me that I have "just moved" the file or if I moved and modified it, so it seems that there are some techniques to detect this :-)
Gerrit change https://git.eclipse.org/r/c/egit/egit/+/196899 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=36b1c66af3ea278626b5a86f37f6e9c06077efe4
Gerrit change https://git.eclipse.org/r/c/egit/egit/+/196898 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=e4880a8cc16fd738fd2f6fde8e082a8e135bab3e
For staged renamed files, I consider this solved. Additionally, there is now a "Compare With Each Other" in the staged and unstaged viewers to compare two staged or two unstaged files. Renamings between the working tree and index or HEAD are hard, and I'm not sure it can be done in any halfway efficient way. It might involve too many file reads to do comparisons. If at all possible I'd like to handle that as part of bug 580240.
Great I think this is already a good achievement!