>From e84cf00a367bded4489cd8defbcb36a5913d3f96 Mon Sep 17 00:00:00 2001 From: Utkarsh Singh Date: Tue, 1 Jun 2021 14:33:01 +0530 Subject: [PATCH] New user option for Git log switches * lisp/vc/vc-git.el (vc-git-print-log): New defcustom `vc-git-diff-switches'. * etc/NEWS: Announce the new option. --- etc/NEWS | 4 ++++ lisp/vc/vc-git.el | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 6622861aaf..db4fc3e7fb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -829,6 +829,10 @@ If non-nil, only branches and remotes are considered when doing completion over Git branch names. The default is nil, which causes tags to be considered as well. +--- +*** New user option 'vc-git-log-switches'. +Strings or list of strings specifying switches for Git log under VC. + ** Gnus +++ diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index e37c09df7c..402685ad1c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -118,6 +118,12 @@ vc-git-diff-switches (repeat :tag "Argument List" :value ("") string)) :version "23.1") +(defcustom vc-git-log-switches t + "Strings or list of strings specifying switches for Git log under VC." + :type '(choice (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string))) + (defcustom vc-git-annotate-switches nil "String or list of strings specifying switches for Git blame under VC. If nil, use the value of `vc-annotate-switches'. If t, use no switches." @@ -1131,6 +1137,8 @@ vc-git-print-log-follow :type 'boolean :version "26.1") +(autoload 'vc-switches "vc") + (defun vc-git-print-log (files buffer &optional shortlog start-revision limit) "Print commit log associated with FILES into specified BUFFER. If SHORTLOG is non-nil, use a short format based on `vc-git-root-log-format'. @@ -1164,6 +1172,7 @@ vc-git-print-log ,(format "--pretty=tformat:%s" (car vc-git-root-log-format)) "--abbrev-commit")) + (vc-switches 'git 'log) (when (numberp limit) (list "-n" (format "%s" limit))) (when start-revision @@ -1385,8 +1394,6 @@ vc-git--asciify-coding-system samp coding-system-for-read t))) (setq coding-system-for-read 'undecided))) -(autoload 'vc-switches "vc") - (defun vc-git-diff (files &optional rev1 rev2 buffer _async) "Get a difference report using Git between two revisions of FILES." (let (process-file-side-effects -- 2.31.1