From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59414: 29.0.50; Have vc-git-expanded-log-entry pass --stat Date: Mon, 05 Dec 2022 14:29:01 +0200 Message-ID: <835yeq9gqa.fsf@gnu.org> References: <874jutjzqj.fsf@melete.silentflame.com> <86ilj9wm14.fsf@mail.linkov.net> <878rk5i8zx.fsf@melete.silentflame.com> <87sfhxynm6.fsf@melete.silentflame.com> <86h6ybgf40.fsf@mail.linkov.net> <877cz6zsi7.fsf@melete.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16984"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59414@debbugs.gnu.org, dgutov@yandex.ru, juri@linkov.net To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 13:30:24 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1p2Ac3-0004Bj-GV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 13:30:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2Abk-0007JD-AT; Mon, 05 Dec 2022 07:30:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Abj-0007J2-ID for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 07:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2Abj-0001xG-2s for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 07:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2Abi-0006S0-Sc for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 07:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2022 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59414 X-GNU-PR-Package: emacs Original-Received: via spool by 59414-submit@debbugs.gnu.org id=B59414.167024336824763 (code B ref 59414); Mon, 05 Dec 2022 12:30:02 +0000 Original-Received: (at 59414) by debbugs.gnu.org; 5 Dec 2022 12:29:28 +0000 Original-Received: from localhost ([127.0.0.1]:35727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Ab9-0006RL-Ow for submit@debbugs.gnu.org; Mon, 05 Dec 2022 07:29:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Ab7-0006RF-O4 for 59414@debbugs.gnu.org; Mon, 05 Dec 2022 07:29:26 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Ab1-0001rU-DU; Mon, 05 Dec 2022 07:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=LKDhInGpaF1j6n24xYYiqIOjoxFtDPBz19C7BWUQkkI=; b=BMtfuWKxaIRuY+qAIaU5 rbnRl9mQtuPyOf9HlI58pygcfIAm/LQvY9Bgff2Er/HjC7omBrd62ySYY00grwMghcr2mZzM3pGWN 1I9J8dldhnZBK002lVoXFDtXFoGqN8lDREK4C2hsmphxaQTxernaddYKlYsZVPobKnMlR1GJXRcyb Ymsqeopltu+iTJQLFbxkwivW3B/Z5M1Ysq5jswlILaxTv4Ru9XnhrkFR6vHhyYOBpd+Y46q2fudaP 5j4C4HT3lc2SRYntvIzXbVxbZFPEwer2B2wtXYUmOFw/kOOY8XjTigOQtbQpl52jyTD/iJEI9i6ji 5gkOWRQzSBmuNg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Ab0-0002wj-No; Mon, 05 Dec 2022 07:29:19 -0500 In-Reply-To: <877cz6zsi7.fsf@melete.silentflame.com> (message from Sean Whitton on Sun, 04 Dec 2022 15:57:52 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250012 Archived-At: > From: Sean Whitton > 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.