Deprecate :Glog defaulting to current file

This commit is contained in:
Tim Pope 2019-01-05 14:03:45 -05:00
parent b9ea3efdf8
commit 29f16cd924
2 changed files with 14 additions and 7 deletions

View File

@ -2840,6 +2840,12 @@ function! s:Log(cmd, bang, line1, line2, ...) abort
\ s:shellesc('--pretty=format:fugitive://'.b:git_dir.'//%H'.path.'::'.g:fugitive_summary_format), '%#')
let &grepformat = '%Cdiff %.%#,%C--- %.%#,%C+++ %.%#,%Z@@ -%\d%\+\,%\d%\+ +%l\,%\d%\+ @@,%-G-%.%#,%-G+%.%#,%-G %.%#,%A%f::%m,%-G%.%#'
exe a:cmd . (a:bang ? '! ' : ' ') . s:ShellExpand(before . after)
if len(path) && a:line2 == -1
redraw
echohl WarningMsg
echo ':Glog will soon default to all files. Use :0Glog to target current file'
echohl NONE
endif
finally
let &grepformat = grepformat
let &grepprg = grepprg

View File

@ -114,17 +114,18 @@ that are part of Git repositories).
:Glgrep[!] [args] |:lgrep|[!] with git-grep as 'grepprg'.
*fugitive-:Glog*
:Glog [args] Load all previous revisions of the current file into
the |quickfix| list. Additional git-log arguments can
be given (for example, --reverse). If "--" appears as
an argument, no file specific filtering is done, and
previous commits rather than previous file revisions
are loaded.
:Glog [args] Load the commit history into the |quickfix| list.
Additional git-log arguments can be given (for
example, --reverse). Provide "--" in the argument
list to target all commits. Otherwise, only commits
changing the current file will be targeted. This
special casing is slated to be removed.
:{range}Glog [args] Use git-log -L to load previous revisions of the given
range of the current file into the |quickfix| list.
The cursor is positioned on the first line of the
first diff hunk for each commit.
first diff hunk for each commit. Use :0Glog to target
the entire file.
*fugitive-:Gllog*
:Gllog [args] Like |:Glog|, but use the location list instead of the