all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Add switches for Git log command
@ 2021-06-01  8:53 Utkarsh Singh
  2021-06-07  0:00 ` Dmitry Gutov
  0 siblings, 1 reply; 9+ messages in thread
From: Utkarsh Singh @ 2021-06-01  8:53 UTC (permalink / raw)
  To: emacs-devel

Hi,

VC provides `vc-print-log' command to view changes in current fileset
which displays hash, author, date and commit message.  By default git
displays date in format 'Mon May 31 07:29:51 2021 +0200' but I wanted
'2021-05-31 07:29:51 +0200' which is supported by '--date=iso' switch.

Currently `vc-print-log' provides no option to tweak it's behaviour with
switches hence I am proposing a patch which introduces a variable
`vc-git-log-switches' to provide the necessary functionally.

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index e37c09df7c..335cb0a403 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."
@@ -1174,7 +1180,8 @@ vc-git-print-log
                     (list start-revision)))
                 (when (eq vc-log-view-type 'with-diff)
                   (list "-p"))
-		'("--")))))))
+                (append (vc-switches 'git 'log)
+		        '("--"))))))))
 
 (defun vc-git-log-outgoing (buffer remote-location)
   (vc-setup-buffer buffer)

-- 
Utkarsh Singh
http://utkarshsingh.xyz



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-09  1:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-01  8:53 [PATCH] Add switches for Git log command Utkarsh Singh
2021-06-07  0:00 ` Dmitry Gutov
2021-06-07  4:17   ` Utkarsh Singh
2021-06-07 12:41     ` Eli Zaretskii
2021-06-08  1:57       ` Utkarsh Singh
2021-06-08 11:27         ` Eli Zaretskii
2021-06-08 14:20           ` Utkarsh Singh
2021-06-08 23:38             ` Dmitry Gutov
2021-06-09  1:19               ` Utkarsh Singh

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.