emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit f31cf79b27 4/4: magit-parse-git-async: Discard


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit f31cf79b27 4/4: magit-parse-git-async: Discard stderr for now
Date: Sun, 21 Jul 2024 13:00:07 -0400 (EDT)

branch: elpa/git-commit
commit f31cf79b2731765d63899ef16bc8be0fa2cc7d32
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-parse-git-async: Discard stderr for now
    
    Currently the only caller is `magit-blame-run-process' and that
    requires that we discard stderr because we would otherwise have
    to explicitly discard gc output.
    
    This will require more work, but not so close before a release.
    
    Closes #5175.
---
 lisp/magit-blame.el   |  1 +
 lisp/magit-process.el | 19 +++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lisp/magit-blame.el b/lisp/magit-blame.el
index 084e1e1923..bdcccb5db2 100644
--- a/lisp/magit-blame.el
+++ b/lisp/magit-blame.el
@@ -453,6 +453,7 @@ modes is toggled, then this mode also gets toggled 
automatically.
   (let ((status (process-status process)))
     (when (memq status '(exit signal))
       (kill-buffer (process-buffer process))
+      (kill-buffer (process-get process 'stderr-buf))
       (if (and (eq status 'exit)
                (zerop (process-exit-status process)))
           (unless quiet
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index dad69c6719..bce02aaebe 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -651,18 +651,21 @@ Magit status buffer."
 (defun magit-parse-git-async (&rest args)
   (setq args (magit-process-git-arguments args))
   (let ((command-buf (current-buffer))
-        (process-buf (generate-new-buffer " *temp*"))
+        (stdout-buf (generate-new-buffer " *git-stdout*"))
+        (stderr-buf (generate-new-buffer " *git-stderr*"))
         (toplevel (magit-toplevel)))
-    (with-current-buffer process-buf
+    (with-current-buffer stdout-buf
       (setq default-directory toplevel)
       (let ((process
-             (let ((process-connection-type nil)
-                   (process-environment (magit-process-environment))
-                   (default-process-coding-system
-                    (magit--process-coding-system)))
-               (apply #'start-file-process "git" process-buf
-                      (magit-git-executable) args))))
+             (let ((process-environment (magit-process-environment)))
+               (make-process :name "git"
+                             :buffer stdout-buf
+                             :stderr stderr-buf
+                             :command (cons (magit-git-executable) args)
+                             :coding (magit--process-coding-system)
+                             :file-handler t))))
         (process-put process 'command-buf command-buf)
+        (process-put process 'stderr-buf stderr-buf)
         (process-put process 'parsed (point))
         (setq magit-this-process process)
         process))))



reply via email to

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