oxygen-git-client-addon
oxygen-git-client-addon copied to clipboard
Handle renamed files
-
If I rename a file using
git mv old_filename new_filename
I expect to see just the new file with a "Renamed" status/icon. The Diff should also be performed between the old and the new files because other changes might have been made (besides the rename). Right now we present the new file as added and the old one as deleted. -
It would be great if we can intercept the "Rename" action from Oxygen's Project view and use a
git mv
if the resource is under Git version control.
FYI: When using Git on the CLI, e.g. with Git Bash, you usually see a deleted file and an untracked file, when renaming it without git mv
, e.g. by Windows Explorer. But if you stage both changes with git add
, Git usually automatically detects, that both changes are a single rename.
I guess one can check the MD5 of all files - if the same MD5 is found on a deleted and on an untracked file then that is actually a move.
Checking the MD5 would work if the content is untouched but in my case I also made changes inside the content. That's why I wanted Oxygen to show me the DIFF between the two. In my particular case I renamed the file from an Eclipse that had the Git plugin. I suspect that Eclipse's Git plugin intercepted the rename because a git status
identified the file as being renamed.