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), '%#') \ 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%.%#' 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) 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 finally
let &grepformat = grepformat let &grepformat = grepformat
let &grepprg = grepprg let &grepprg = grepprg

View File

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