From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow Date: Tue, 20 Feb 2018 22:39:25 +0200 Organization: LINKOV.NET Message-ID: <87sh9vtmyq.fsf@mail.linkov.net> References: <87d28rt4jl.fsf@telefonica.net> <874lmxloo1.fsf@mail.linkov.net> <87d11kquw2.fsf@mail.linkov.net> <9c8f9d73-af0d-fdc7-7935-1a8a904c5c15@yandex.ru> <87607bunrz.fsf@mail.linkov.net> <52b6e1bb-5657-722f-eafe-73fc6c3a82a4@yandex.ru> <87r2pxvlah.fsf@mail.linkov.net> <87d11csg1u.fsf@mail.linkov.net> <2f104cc5-6629-b74c-4a9b-4d678d888841@yandex.ru> <87bmgpoqjr.fsf@mail.linkov.net> <83r2ple53c.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1519162530 14075 195.159.176.226 (20 Feb 2018 21:35:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Feb 2018 21:35:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 19045@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 20 22:35:25 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoFZI-00030A-Fb for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Feb 2018 22:35:20 +0100 Original-Received: from localhost ([::1]:57879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoFbK-0003hp-ID for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Feb 2018 16:37:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoFb0-0003dG-AJ for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 16:37:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoFax-0000ua-PF for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 16:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45437) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eoFax-0000uT-Kl for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 16:37:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eoFax-0003BI-EH for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 16:37:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Feb 2018 21:37:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19045 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19045-submit@debbugs.gnu.org id=B19045.151916256812086 (code B ref 19045); Tue, 20 Feb 2018 21:37:03 +0000 Original-Received: (at 19045) by debbugs.gnu.org; 20 Feb 2018 21:36:08 +0000 Original-Received: from localhost ([127.0.0.1]:53319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoFa3-00038s-Kx for submit@debbugs.gnu.org; Tue, 20 Feb 2018 16:36:07 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:59992 helo=homiemail-a15.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoFa2-00038k-N7 for 19045@debbugs.gnu.org; Tue, 20 Feb 2018 16:36:07 -0500 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 91ED476C06B; Tue, 20 Feb 2018 13:36:05 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-98-215.cust.tele2.ee [91.129.98.215]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 3FF5D76C069; Tue, 20 Feb 2018 13:36:04 -0800 (PST) In-Reply-To: <83r2ple53c.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Feb 2018 10:00:55 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143517 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> - (message "Running %s in background..." full-command)) >> + (message "Running in background: %s" full-command)) > ^^ > Extra blank. > >> - (message "Running %s in background... done" full-command)))) >> + (let ((message-truncate-lines t)) >> + (message "Finished in background: %s" full-command))))) > > I find the original more in line with what we do elsewhere in Emacs. > If the problem is that "done" could be truncated, then please use > > Done in background: %s Then extra blank is not needed when using =E2=80=9CDone in background=E2=80= =9D because it would require too many blanks to align with =E2=80=9CFinished in backgrou= nd=E2=80=9D. >> - (error "Running %s...FAILED (%s)" full-command >> - (if (integerp status) (format "status %d" status) status))) >> + (error "Failed (%s): %s" >> + (if (integerp status) (format "status %d" status= ) status) >> + full-command)) >> (when vc-command-messages >> - (message "Running %s...OK =3D %d" full-command status)))) >> + (message "Success (%d): %s" status full-command)))) > > "Failed" and "Success" don't go together well, as they use different > grammatical form. How about using "Done" here as well? And won't > status always be zero when it succeeds? If not, I'd use I see that the status in case of success is 1. > Done (status=3D%d): %s Done in the following patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-dispatcher.patch diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index b0d2221..da9d346 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -290,16 +290,16 @@ vc-do-command (let* ((files (mapcar (lambda (f) (file-relative-name (expand-file-name f))) (if (listp file-or-list) file-or-list (list file-or-list)))) + ;; Keep entire commands in *Messages* but avoid resizing the + ;; echo area. Messages in this function are formatted in + ;; a such way that the important parts are at the beginning, + ;; due to potential truncation of long messages. + (message-truncate-lines t) (full-command - ;; What we're doing here is preparing a version of the command - ;; for display in a debug-progress message. If it's fewer than - ;; 20 characters display the entire command (without trailing - ;; newline). Otherwise display the first 20 followed by an ellipsis. (concat (if (string= (substring command -1) "\n") (substring command 0 -1) command) - " " - (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...") s)) flags)) + " " (vc-delistify flags) " " (vc-delistify files)))) (save-current-buffer (unless (or (eq buffer t) @@ -324,7 +324,7 @@ vc-do-command (apply 'start-file-process command (current-buffer) command squeezed)))) (when vc-command-messages - (message "Running %s in background..." full-command)) + (message "Running in background: %s" full-command)) ;; Get rid of the default message insertion, in case we don't ;; set a sentinel explicitly. (set-process-sentinel proc #'ignore) @@ -332,10 +332,11 @@ vc-do-command (setq status proc) (when vc-command-messages (vc-run-delayed - (message "Running %s in background... done" full-command)))) + (let ((message-truncate-lines t)) + (message "Done in background: %s" full-command))))) ;; Run synchronously (when vc-command-messages - (message "Running %s in foreground..." full-command)) + (message "Running in foreground: %s" full-command)) (let ((buffer-undo-list t)) (setq status (apply 'process-file command nil t nil squeezed))) (when (and (not (eq t okstatus)) @@ -345,13 +346,14 @@ vc-do-command (pop-to-buffer (current-buffer)) (goto-char (point-min)) (shrink-window-if-larger-than-buffer)) - (error "Running %s...FAILED (%s)" full-command - (if (integerp status) (format "status %d" status) status))) + (error "Failed (%s): %s" + (if (integerp status) (format "status %d" status) status) + full-command)) (when vc-command-messages - (message "Running %s...OK = %d" full-command status)))) + (message "Done (status=%d): %s" status full-command)))) (vc-run-delayed - (run-hook-with-args 'vc-post-command-functions - command file-or-list flags)) + (run-hook-with-args 'vc-post-command-functions + command file-or-list flags)) status)))) (defun vc-do-async-command (buffer root command &rest args) --=-=-=--