all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: 59414@debbugs.gnu.org, dgutov@yandex.ru, juri@linkov.net
Subject: bug#59414: 29.0.50; Have vc-git-expanded-log-entry pass --stat
Date: Mon, 05 Dec 2022 14:29:01 +0200	[thread overview]
Message-ID: <835yeq9gqa.fsf@gnu.org> (raw)
In-Reply-To: <877cz6zsi7.fsf@melete.silentflame.com> (message from Sean Whitton on Sun, 04 Dec 2022 15:57:52 -0700)

> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Sun, 04 Dec 2022 15:57:52 -0700
> 
> @@ -1340,16 +1348,16 @@ vc-git-print-log
>  
>  (defun vc-git-log-outgoing (buffer remote-location)
>    (vc-setup-buffer buffer)
> -  (vc-git-command
> -   buffer 'async nil
> -   "log"
> -   "--no-color" "--graph" "--decorate" "--date=short"
> -   (format "--pretty=tformat:%s" (car vc-git-root-log-format))
> -   "--abbrev-commit"
> -   (concat (if (string= remote-location "")
> -	       "@{upstream}"
> -	     remote-location)
> -	   "..HEAD")))
> +  (apply #'vc-git-command buffer 'async nil
> +         `("log"
> +           "--no-color" "--graph" "--decorate" "--date=short"
> +           ,(format "--pretty=tformat:%s" (car vc-git-root-log-format))
> +           "--abbrev-commit"
> +           ,@(ensure-list vc-git-shortlog-switches)
> +           ,(concat (if (string= remote-location "")
> +	                "@{upstream}"
> +	              remote-location)
> +	            "..HEAD"))))

Why the change from vc-git-command to 'apply'?  The former took care for
setting up the I/O encoding for the Git command, while the latter just uses
the process defaults, which are not necessarily right for the underlying
system and locale.

In general, I'd prefer that invocations of all the Git commands went through
a single function, so that we could make sure the encoding/decoding stuff,
which is entirely non-trivial with Git, is done correctly in a single place
that is easy to audit and maintain.  I know that not all the commands are
invoked through there, but making more of them do so is going in the
direction that is 180° opposite to what we should strive to.

Thanks.





  parent reply	other threads:[~2022-12-05 12:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 17:35 bug#59414: 29.0.50; Have vc-git-expanded-log-entry pass --stat Sean Whitton
2022-11-20 17:52 ` Juri Linkov
2022-11-20 20:14   ` Dmitry Gutov
2022-11-20 21:58   ` Sean Whitton
2022-11-20 22:11     ` Dmitry Gutov
2022-11-21 20:29       ` Sean Whitton
2022-12-03  7:04     ` Sean Whitton
2022-12-04 19:19       ` Juri Linkov
2022-12-04 22:57         ` Sean Whitton
2022-12-05  0:54           ` Dmitry Gutov
2022-12-05  5:09             ` Sean Whitton
2022-12-05 12:29           ` Eli Zaretskii [this message]
2022-12-05 12:40             ` Dmitry Gutov
2022-12-05 12:57               ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=835yeq9gqa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59414@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=juri@linkov.net \
    --cc=spwhitton@spwhitton.name \
    /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 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.