by ozay · 2y ago · 0 comments
There are a few options that help you out with this:
-M Detect moved or copied lines within a file
-C In addition to -M, detect lines moved or copied from other files that were modified in the same commit.
--ignore-rev <rev> Ignore changes made by the revision when assigning blame, as if the change never happened
--ignore-revs-file <file> Ignore revisions listed in file
I use short options interactively on the command line, but in scripts and when communicating with other people, I prefer longer options because they are self-documenting and can catch most typos. (For a long option, typos are more likely to result in an invalid option, and thus an error message. For one-letter options, a typo could result in anything..)
https://magit.vc/manual/magit/Commands-for-Buffers-Visiting-...
nnoremap <leader>gc :Gshow <C-R><C-W><cr>
command! -nargs=1 Gshow enew | set ft=diff buftype=nofile | 0r!git log -p -n 1 "<args>"
command! -nargs=0 Glogf tabnew | set ft=diff buftype=nofile | 0r!git -C "#:h" log -p --follow "#:t"
command! -nargs=0 -range Glogr tabnew | set ft=diff buftype=nofile | 0r!git -C "#:h" log -L "<line1>,<line2>:#:t"