Always use temp file for :Git diff and :Git log

You can use :Git -p log to get a terminal instead.
This commit is contained in:
Tim Pope 2019-08-02 13:29:59 -04:00
parent 9118ed27c3
commit 4c0dbb66eb
2 changed files with 3 additions and 2 deletions

View File

@ -2104,7 +2104,7 @@ function! s:GitCommand(line1, line2, range, count, bang, mods, reg, arg, args) a
let cmd = s:StatusCommand(a:line1, a:line2, a:range, a:count, a:bang, a:mods, a:reg, '', []) let cmd = s:StatusCommand(a:line1, a:line2, a:range, a:count, a:bang, a:mods, a:reg, '', [])
return (empty(cmd) ? 'exe' : cmd) . after return (empty(cmd) ? 'exe' : cmd) . after
endif endif
if a:bang || args[0] =~# '^-P$\|^--no-pager$' if a:bang || args[0] =~# '^-P$\|^--no-pager$\|diff\%(tool\)\@!\|log'
return s:OpenExec((a:count > 0 ? a:count : '') . (a:count ? 'split' : 'edit'), a:mods, args, dir) . after return s:OpenExec((a:count > 0 ? a:count : '') . (a:count ? 'split' : 'edit'), a:mods, args, dir) . after
endif endif
let git = s:UserCommandList(dir) let git = s:UserCommandList(dir)

View File

@ -26,7 +26,8 @@ that are part of Git repositories).
*fugitive-:Git!* *fugitive-:Git!*
:Git! {args} Like |:Git|, but capture the output into a temp file, :Git! {args} Like |:Git|, but capture the output into a temp file,
:Git --no-pager {args} and |:split| that that temp file. Use :0Git to :Git --no-pager {args} and |:split| that that temp file. Use :0Git to
:Git -P {args} |:edit| the temp file instead. :Git -P {args} |:edit| the temp file instead. A temp file is always
used for diff and log commands.
*fugitive-:Gcd* *fugitive-:Gcd*
:Gcd [directory] |:cd| relative to the repository. :Gcd [directory] |:cd| relative to the repository.