From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Utkarsh Singh Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add switches for Git log command Date: Tue, 08 Jun 2021 07:27:37 +0530 Message-ID: <875yypazji.fsf@gmail.com> References: <87k0nej78o.fsf@gmail.com> <7ddd9a69-d1ff-132f-66ed-a9b5526d2ce7@yandex.ru> <871r9eqpej.fsf@gmail.com> <8335tthmox.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20849"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 08 03:58:01 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqR0C-000597-9A for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Jun 2021 03:58:00 +0200 Original-Received: from localhost ([::1]:37454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqR0A-0004UZ-4m for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Jun 2021 21:57:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqQze-0003oh-Ls for emacs-devel@gnu.org; Mon, 07 Jun 2021 21:57:26 -0400 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:44810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqQzc-0004oD-PH; Mon, 07 Jun 2021 21:57:26 -0400 Original-Received: by mail-pf1-x42f.google.com with SMTP id u18so14481291pfk.11; Mon, 07 Jun 2021 18:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Sw3b2L0T1EQW0tOsuEw9LNbJF+dFPkhzv+3sE/LVmBM=; b=un+dUNTfYU4r+zSX+Gxj4wd+eCmOZyDJwEBwviHFLryyGM9Ihk962bDtUYUu4cSWc3 xNACuUR8LpZ8ZgBcZ2FH3IvB4ZUS7q6eUiYS2qt8Mwdsp610lRftUkLy+SM0O6GqJy9O y3O5CpayOSRUMQ6wuFgadUFRI36yqNVkZXDY5Q0htpVBQSCy6i05S2z+T2FdbzecPJEo OdAWMDPZV9Xhd8cohwrMFIZJjrOmnfsjfUxcyoXdtHkmmHfpDcgF5JSkPcgeXAePC6cc KkZ1vVcEvnD1d9sT802W4fwI7rI45EJEa+/ANw622YK3KqJ9bQQtoc1w5Sb7FUIdptPi yUIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Sw3b2L0T1EQW0tOsuEw9LNbJF+dFPkhzv+3sE/LVmBM=; b=DAVO6jhBsO/jTC2/em+JFzhOvNzyaqsO5uBp2xICLzJdG+m6fJ7uW4FSMmHinhJYXq NjTEejXkLWwuBLVgCCi8EUzKfkSB/ci6ZMbGjDzaZjsVHiak3KWwlAubJVni7iw7x5Cl 2o13AapepGph8KQAZP0Ukiruxw4PXgSo+OTQgmIXEfkfZ3BSS2g0mOFBw1+TEsBuHK9R Ye+OVYaiAHys8huY2qDhl06Es4592LAEAW3gU1qijGBxjUBZWuTPpg1BUs32Zfo0xffv /tS35j4GR7Kbwj7HsX9XSkHKRvZojZ3aaxj+/caxSv5jgqVxxUxfMnCotVF1+xNFByK9 Y4SQ== X-Gm-Message-State: AOAM531ZZvKHo3dvm7W0+R3KVsw8tSgtExRgsjYS5RLxnqbreurkGLTd qYUELMCzDc/Ryyvk4EF71B4rXfZrlE0= X-Google-Smtp-Source: ABdhPJzQBzzByCmpd6oJSacVK4jQx2Ic9OGHN+Ze0j6o6O1FJP70x11MaImb0DXNkLxoqyleKzi9lA== X-Received: by 2002:a62:7e05:0:b029:2ea:57f:ec86 with SMTP id z5-20020a627e050000b02902ea057fec86mr19478051pfc.37.1623117442322; Mon, 07 Jun 2021 18:57:22 -0700 (PDT) Original-Received: from localhost ([103.77.1.19]) by smtp.gmail.com with ESMTPSA id z185sm9854161pgb.4.2021.06.07.18.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 18:57:21 -0700 (PDT) In-Reply-To: <8335tthmox.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=utkarsh190601@gmail.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_OTHER_BAD_TLD=1.997, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270549 Archived-At: --=-=-= Content-Type: text/plain On 2021-06-07, 15:41 +0300, Eli Zaretskii wrote: >> From: Utkarsh Singh >> Date: Mon, 07 Jun 2021 09:47:40 +0530 >> >> +(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))) > > New or changed defcustoms should have a :version tag. Done. -- Utkarsh Singh http://utkarshsingh.xyz --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-user-option-for-Git-log-switches.patch Content-Description: patch >From 0b22fdc37713de8fdfb489a10d38b960e166304b 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 | 12 ++++++++++-- 2 files changed, 14 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..eb9b701e2e 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -118,6 +118,13 @@ 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)) + :version "28.1") + (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 +1138,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 +1173,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 +1395,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 --=-=-=--