emacs-diffs
[Top][All Lists]
Advanced

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

master e50a3b5792: Make "git pull" output slightly prettier


From: Lars Ingebrigtsen
Subject: master e50a3b5792: Make "git pull" output slightly prettier
Date: Sat, 1 Oct 2022 10:06:43 -0400 (EDT)

branch: master
commit e50a3b57921e8b690d3c3adb993e2441d5970116
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make "git pull" output slightly prettier
    
    * lisp/vc/vc-git.el (vc-git--pushpull): Translate ^M in output
    (bug#58199).
---
 lisp/vc/vc-git.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index f5ac43f536..87f6a5a37c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1110,6 +1110,14 @@ If PROMPT is non-nil, prompt for the Git command to run."
             vc-filter-command-function))
          (proc (apply #'vc-do-async-command
                       buffer root git-program command extra-args)))
+    ;; "git pull" includes progress output that uses ^M to move point
+    ;; to the beginning of the line.  Just translate these to newlines
+    ;; (but don't do anything with the CRLF sequence).
+    (add-function :around (process-filter proc)
+                  (lambda (filter process string)
+                    (funcall filter process
+                             (replace-regexp-in-string "\r\\(\\'\\|[^\n]\\)"
+                                                       "\n\\1" string))))
     (with-current-buffer buffer
       (vc-run-delayed
         (vc-compilation-mode 'git)



reply via email to

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