tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
20.03k stars 1.01k forks source link

Diffing a renamed file among different commits #2248

Closed SureshGovindachar closed 7 months ago

SureshGovindachar commented 10 months ago

Issue: unable to figure out how to use vim-fugitive to diff renamed files among different commits:

# in repo <hash> that contains old/path/to/file               
# some edits and commits                                      
# git mv old/path/to/file  current/path/to/file               
# edit and commit current/path/to/file                        
# following two commands work in the bash shell              
# Issue: how would such a diff be done using vim-fugitive?
git difftool <hash> -- old/path/to/file  current/path/to/file 
git diff <hash> -- old/path/to/file  current/path/to/file     
kmARC commented 7 months ago

Try specifying it via the : format:

git difftool <hash>:old/path/to/file current/path/to/file
SureshGovindachar commented 7 months ago

Try specifying it via the : format: git difftool ...

So the suggestion being made to use :Gvdiff <hash>:old/path/to/file -- this worked. Thanks @kmARC .

SureshGovindachar commented 7 months ago

It is OK to close this ticket.