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

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

[elpa] externals/gited 475e297 72/73: Support Gited buffers over a tramp


From: Stefan Monnier
Subject: [elpa] externals/gited 475e297 72/73: Support Gited buffers over a tramp connection
Date: Sun, 29 Nov 2020 00:00:42 -0500 (EST)

branch: externals/gited
commit 475e29723ad2d5ff08cae5fdaa122ab56e69141b
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>

    Support Gited buffers over a tramp connection
    
    Bump version to 0.6.0.
    * packages/gited/gited.el (gited-git-command): Use process-file.
    
    (gited-async-operation): Use start-file-process-shell-command.
    
    (gited-git-command-on-region): Handle Gited buffers
    from tramp connections.
---
 gited.el | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/gited.el b/gited.el
index b61e03e..67f67e0 100644
--- a/gited.el
+++ b/gited.el
@@ -8,11 +8,11 @@
 
 ;; Created: Wed Oct 26 01:28:54 JST 2016
 ;; Compatibility: GNU Emacs: 24.4
-;; Version: 0.5.7
+;; Version: 0.6.0
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;; Last-Updated: Sat Sep 14 15:58:36 CEST 2019
+;; Last-Updated: Sat Sep 14 17:54:26 CEST 2019
 ;;           By: calancha
-;;     Update #: 702
+;;     Update #: 703
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -859,7 +859,7 @@ Optional arg BUFFER is the output buffer.
 Optional arg DISPLAY means redisplay buffer as output is inserted.
 Optional arg UNQUOTE removes single quotes from the output."
   (prog1
-      (apply #'call-process vc-git-program nil buffer display args)
+      (apply #'process-file vc-git-program nil buffer display args)
     (when (and unquote buffer (buffer-live-p buffer))
       (with-current-buffer buffer
         ;; Drop single quotes.
@@ -907,7 +907,16 @@ Optional arg UNQUOTE removes single quotes from the 
output."
   "Execute a Git command with arguments ARGS and region as input.
 Optional arg BUFFER is the output buffer.
 Optional arg DISPLAY means redisplay buffer as output is inserted."
-  (apply #'call-process-region nil nil vc-git-program nil buffer display args))
+  ;; Adapted from `project--process-file-region' in project.el
+  (if (not (file-remote-p default-directory))
+      (apply #'call-process-region
+             nil nil vc-git-program nil buffer display args)
+    (let ((infile (make-temp-file "ggcor")))
+      (unwind-protect
+          (progn
+            (write-region nil nil infile nil 'silent)
+            (apply #'process-file vc-git-program infile buffer display args))
+        (delete-file infile)))))
 
 (defun gited-all-branches ()
   "Return a list with all (local and remote) branches and tags."
@@ -1152,7 +1161,7 @@ Optional arg CALLBACK is called if COMMAND completes 
successfully."
         (when remote-op-p
           (display-buffer out-buf '(nil (allow-no-window . t))))
         (setq default-directory directory
-              proc (start-process-shell-command
+              proc (start-file-process-shell-command
                     "*gited-async-operation*" out-buf command)
               mode-line-process '(":%s"))
         (with-current-buffer gited-buf



reply via email to

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