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: [PATCH] Add switches for Git log command Date: Tue, 01 Jun 2021 14:23:43 +0530 Message-ID: <87k0nej78o.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34762"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 01 10:54:19 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 1lo0AE-0008oY-I1 for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Jun 2021 10:54:18 +0200 Original-Received: from localhost ([::1]:52778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo0AD-0003nT-8t for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Jun 2021 04:54:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo09Y-00037C-51 for emacs-devel@gnu.org; Tue, 01 Jun 2021 04:53:36 -0400 Original-Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:38645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lo09W-0004bo-2Y for emacs-devel@gnu.org; Tue, 01 Jun 2021 04:53:35 -0400 Original-Received: by mail-pj1-x102b.google.com with SMTP id m13-20020a17090b068db02901656cc93a75so1009915pjz.3 for ; Tue, 01 Jun 2021 01:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=xQYGZPk416P6eMILrESlh+zbxqW4inpDU4Y7Jqlm8eY=; b=NjyBiJBgH0Mr1m9LLy6o5WZzVU+FnX9Aqa1Nb1Bk0Dc+PFwj1O5JrtIR8/CmMtEz0A hke0NEgXz0cS8b7gB27nXkvbMn86D5p3KqU+N3pgznGr6ECQa+GXVfyHcjWIfMGMK6L0 4ITKguw7Zj+4bZVlK76+MBt1SE2i78jsf6ePMEnF2om02N5337q2sRS5YEZ+qLUF5GMn 5Gzgc1TffT8FLFJs3wsyUz3oUSKaGllt5KVFTDSu+wVE8aRpLCSmq4IPe48wXlCnObW8 HYeAApFsmuvCmioLeAZPKg47IoufgJ8yEy+tA8bvP8Xh/KuWe7zU022ObHbYrBFBnTfV 9Vgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=xQYGZPk416P6eMILrESlh+zbxqW4inpDU4Y7Jqlm8eY=; b=WuVQZB9XplDv5eJGqlCP4lR024K+fvV3rKv6rqYLEw/J8XcAzWG9Nlxkc+pKdu+nhF pNUVwSTwXky2I3z5necUSL59XLcROopXBTjwxDn+ZTZIy0drU1DKP41kLMXnvzPP4KTL Qia7EqncOLqaHBei/NZs6mg5cSLX5NIE4NZ+6+vEHfMAV24YqDoMTXL5vcwJKUrgdTnX PYoJ7rDTyfExSo5UXa9Q+sLB9lFyXnwQxA+gOFdJFYWBX3JSCfy77YchRYm4hqhOgRwb zPvAFyYVFZkt+zd2NeuCmHwDORxsoRKLOfBkR3BJaK6nrV9IjwTHgtXSLBid1QNLjYC6 jBiQ== X-Gm-Message-State: AOAM5333bUZ1wIs7hWVZYgx+Jdy5Oj+2OPFL1Yt6hdtUIaGJ9qzmFts6 l/NogIrdSsbOjtc56IJYRZj4ParScuE= X-Google-Smtp-Source: ABdhPJwx1uc+We0hSWX4R4HCDZ8XAp+bKIYycPuuIjB8zCpLwHeoLXg8JCSX0CR4wDlaUboxVjBzDw== X-Received: by 2002:a17:902:c60b:b029:f1:55a:7fe1 with SMTP id r11-20020a170902c60bb02900f1055a7fe1mr25055472plr.33.1622537612082; Tue, 01 Jun 2021 01:53:32 -0700 (PDT) Original-Received: from localhost ([43.230.65.163]) by smtp.gmail.com with ESMTPSA id d22sm13757148pgb.15.2021.06.01.01.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 01:53:31 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=utkarsh190601@gmail.com; helo=mail-pj1-x102b.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:270187 Archived-At: 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