From: Utkarsh Singh <utkarsh190601@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>, emacs-devel@gnu.org
Subject: Re: [PATCH] Add switches for Git log command
Date: Mon, 07 Jun 2021 09:47:40 +0530 [thread overview]
Message-ID: <871r9eqpej.fsf@gmail.com> (raw)
In-Reply-To: <7ddd9a69-d1ff-132f-66ed-a9b5526d2ce7@yandex.ru>
[-- Attachment #1: Type: text/plain, Size: 873 bytes --]
On 2021-06-07, 03:00 +0300, Dmitry Gutov <dgutov@yandex.ru> wrote:
> On 01.06.2021 11:53, Utkarsh Singh wrote:
>> 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.
>
> I'm good with this.
Thank you for accepting my feature request.
> Could you resend the change as attachment, preferably with a commit
> message written to our standard? 'git format-patch' can help.
Yes!
--
Utkarsh Singh
http://utkarshsingh.xyz
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 2604 bytes --]
From e84cf00a367bded4489cd8defbcb36a5913d3f96 Mon Sep 17 00:00:00 2001
From: Utkarsh Singh <utkarsh190601@gmail.com>
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
next prev parent reply other threads:[~2021-06-07 4:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871r9eqpej.fsf@gmail.com \
--to=utkarsh190601@gmail.com \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).