bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow


From: Juri Linkov
Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 16 Feb 2018 00:07:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> "Running %s in foreground..."
>
> Same as with "background".
>
>> "Running %s...OK = %d"
>
> Success (status 0): ...
>
>> "Running %s...FAILED (%s)"
>
> Failed  (status 3): ...
>
> Something like that. If the exit code is longer than 1 digit (pretty rare),
> maybe remove the extra space after "Failed".

Like this?

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..c1de2f0 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,12 @@ 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))))
+        (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 +320,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 +328,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 "Finished 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 +342,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 "Success (%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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]