oxygen-git-client-addon icon indicating copy to clipboard operation
oxygen-git-client-addon copied to clipboard

Handle renamed files

Open AlexJitianu opened this issue 7 years ago • 3 comments

  1. 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.

  2. 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.

AlexJitianu avatar Oct 04 '17 13:10 AlexJitianu

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.

stefan-jung avatar Oct 04 '17 13:10 stefan-jung

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.

georgebina avatar Oct 04 '17 17:10 georgebina

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.

AlexJitianu avatar Oct 05 '17 07:10 AlexJitianu