branch: master commit a716a6fc6d7c8e62a3cf0202a3f443c53bb25927 Author: Tino Calancha <tino.calan...@gmail.com> Commit: Tino Calancha <tino.calan...@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. --- packages/gited/gited.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/gited/gited.el b/packages/gited/gited.el index b61e03e..67f67e0 100644 --- a/packages/gited/gited.el +++ b/packages/gited/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