From 29f16cd92423e2bf399ef30d6bdc4644467601a8 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 5 Jan 2019 14:03:45 -0500 Subject: [PATCH] Deprecate :Glog defaulting to current file --- autoload/fugitive.vim | 6 ++++++ doc/fugitive.txt | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e878698..1e9df5a 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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 diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 51c6e65..b9df1f0 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -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