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

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

[nongnu] elpa/git-commit 2286a63974: Fix applying changes over Tramp fro


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 2286a63974: Fix applying changes over Tramp from Windows
Date: Sat, 14 Jan 2023 11:59:29 -0500 (EST)

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

    Fix applying changes over Tramp from Windows
    
    `process-send-eof' seems to be broken in this case, breaking commands
    that receive input (most noticeably and notably staging and other
    apply variants).  So just use (process-send-string process "").
    
    Hopefully this kludge doesn't break anything else.  It would be
    better if someone investigated the issue and fixed it properly.
    See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43226
    
    Closes #3624.
---
 docs/magit.org        | 13 -------------
 docs/magit.texi       | 16 ----------------
 lisp/magit-process.el |  7 ++++++-
 3 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/docs/magit.org b/docs/magit.org
index a42cfaadfa..0d1a4f6f21 100644
--- a/docs/magit.org
+++ b/docs/magit.org
@@ -9053,19 +9053,6 @@ always visible.  If that is too drastic for your taste, 
then you may
 instead use ~magit-diff-visit-file-hook~ to reveal the text, possibly
 using ~reveal-post-command~ or for Org buffers ~org-reveal~.
 
-*** I am unable to stage when using Tramp from MS Windows
-
-Magit may be unable to stage (or otherwise apply) individual hunks
-when you are connected to remote machine using Tramp and the local
-machine uses MS Windows.
-
-There appears to be a problem with ~process-send-eof~ in this scenario,
-as mentioned at the end of ~tramp-tests.el~.  I have contacted the Tramp
-maintainer about this.  For now this unfortunately means that it just
-doesn't work and we cannot do anything about it.  If you have more
-information, then please comment on
-https://github.com/magit/magit/issues/3624.
-
 *** I am no longer able to save popup defaults
 
 Magit used to use Magit-Popup to implement the transient popup menus.
diff --git a/docs/magit.texi b/docs/magit.texi
index b6d9c92fd0..01725d838b 100644
--- a/docs/magit.texi
+++ b/docs/magit.texi
@@ -333,7 +333,6 @@ FAQ - Issues and Errors
 * My Git hooks work on the command-line but not inside Magit::
 * @code{git-commit-mode} isn't used when committing from the command-line::
 * Point ends up inside invisible text when jumping to a file-visiting buffer::
-* I am unable to stage when using Tramp from MS Windows::
 * I am no longer able to save popup defaults::
 
 
@@ -10844,7 +10843,6 @@ the value of @code{vc-handled-backends}.
 * My Git hooks work on the command-line but not inside Magit::
 * @code{git-commit-mode} isn't used when committing from the command-line::
 * Point ends up inside invisible text when jumping to a file-visiting buffer::
-* I am unable to stage when using Tramp from MS Windows::
 * I am no longer able to save popup defaults::
 @end menu
 
@@ -11044,20 +11042,6 @@ always visible.  If that is too drastic for your 
taste, then you may
 instead use @code{magit-diff-visit-file-hook} to reveal the text, possibly
 using @code{reveal-post-command} or for Org buffers @code{org-reveal}.
 
-@node I am unable to stage when using Tramp from MS Windows
-@appendixsubsec I am unable to stage when using Tramp from MS Windows
-
-Magit may be unable to stage (or otherwise apply) individual hunks
-when you are connected to remote machine using Tramp and the local
-machine uses MS Windows.
-
-There appears to be a problem with @code{process-send-eof} in this scenario,
-as mentioned at the end of @code{tramp-tests.el}.  I have contacted the Tramp
-maintainer about this.  For now this unfortunately means that it just
-doesn't work and we cannot do anything about it.  If you have more
-information, then please comment on
-@uref{https://github.com/magit/magit/issues/3624}.
-
 @node I am no longer able to save popup defaults
 @appendixsubsec I am no longer able to save popup defaults
 
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index 7e724657ac..7cd7b71679 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -596,7 +596,12 @@ Magit status buffer."
     (when input
       (with-current-buffer input
         (process-send-region process (point-min) (point-max))
-        (process-send-eof    process)))
+        ;; `process-send-eof' appears to be broken over
+        ;;  Tramp from Windows. See #3624 and bug#43226.
+        (if (and (eq system-type 'windows-nt)
+                 (file-remote-p (process-get process 'default-dir) nil t))
+            (process-send-string process "")
+          (process-send-eof process))))
     (setq magit-this-process process)
     (oset section value process)
     (magit-process-display-buffer process)



reply via email to

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