unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes
@ 2019-12-20 14:53 Robert Pluim
  2019-12-20 15:50 ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2019-12-20 14:53 UTC (permalink / raw)
  To: 38688

When visiting a remote git repo using tramp, if you subsequently run
'vc-dir', then emacs will hang forever if the remote repo has
stashes. This turned out to be to me having

         pager = less -FRXI

in my remote .gitconfig. Unsetting that fixes it, but vc-git should
perhaps take care to run git with '--no-pager' (it already does
something similar in 'vc-git-command').

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index cdb50db0d0..246fe77f1f 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1791,7 +1791,7 @@ vc-git--call
 	    ,@(when revert-buffer-in-progress-p
 		'("GIT_OPTIONAL_LOCKS=0")))
 	  process-environment)))
-    (apply 'process-file vc-git-program nil buffer nil command args)))
+    (apply 'process-file vc-git-program nil buffer nil "--no-pager" command args)))
 
 (defun vc-git--out-ok (command &rest args)
   (zerop (apply 'vc-git--call '(t nil) command args)))

In GNU Emacs 27.0.50 (build 27, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G1012))
 of 2019-12-12 built on rpluim-mac
Repository revision: d1f1e3640d7940718e7b878803d0b80709b60234
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.6





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes
  2019-12-20 14:53 bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes Robert Pluim
@ 2019-12-20 15:50 ` Dmitry Gutov
  2020-01-10 15:40   ` Robert Pluim
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2019-12-20 15:50 UTC (permalink / raw)
  To: Robert Pluim, 38688

On 20.12.2019 16:53, Robert Pluim wrote:
> When visiting a remote git repo using tramp, if you subsequently run
> 'vc-dir', then emacs will hang forever if the remote repo has
> stashes. This turned out to be to me having
> 
>           pager = less -FRXI
> 
> in my remote .gitconfig. Unsetting that fixes it, but vc-git should
> perhaps take care to run git with '--no-pager' (it already does
> something similar in 'vc-git-command').

Thanks for the report.

We can probably remove the "PAGER=" variable binding from that fuction 
as well.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes
  2019-12-20 15:50 ` Dmitry Gutov
@ 2020-01-10 15:40   ` Robert Pluim
       [not found]     ` <becd4f7d-2824-bf15-932d-b0fb45af12d7@yandex.ru>
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2020-01-10 15:40 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 38688

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

>>>>> On Fri, 20 Dec 2019 17:50:50 +0200, Dmitry Gutov <dgutov@yandex.ru> said:

    Dmitry> On 20.12.2019 16:53, Robert Pluim wrote:
    >> When visiting a remote git repo using tramp, if you subsequently run
    >> 'vc-dir', then emacs will hang forever if the remote repo has
    >> stashes. This turned out to be to me having
    >> pager = less -FRXI
    >> in my remote .gitconfig. Unsetting that fixes it, but vc-git should
    >> perhaps take care to run git with '--no-pager' (it already does
    >> something similar in 'vc-git-command').

    Dmitry> Thanks for the report.

    Dmitry> We can probably remove the "PAGER=" variable binding from that fuction
    Dmitry> as well.

True. The attached works for me. emacs-27 or master?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-vc-dir-ensure-we-don-t-use-a-pager-with-git.patch --]
[-- Type: text/x-patch, Size: 1146 bytes --]

From 09d1602de858ad1ce46a993fca20e1b573599fa9 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Fri, 10 Jan 2020 16:36:57 +0100
Subject: [PATCH] vc-dir: ensure we don't use a pager with git
To: emacs-devel@gnu.org

* lisp/vc/vc-git.el (vc-git--call): Call git with '--no-pager' to
avoid hangs caused by remote pager settings (Bug#38688).
---
 lisp/vc/vc-git.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 000d860e83..61e6c642d1 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1785,13 +1785,12 @@ vc-git--call
 	(process-environment
 	 (append
 	  `("GIT_DIR"
-	    "PAGER="
 	    ;; Avoid repository locking during background operations
 	    ;; (bug#21559).
 	    ,@(when revert-buffer-in-progress-p
 		'("GIT_OPTIONAL_LOCKS=0")))
 	  process-environment)))
-    (apply 'process-file vc-git-program nil buffer nil command args)))
+    (apply 'process-file vc-git-program nil buffer nil "--no-pager" command args)))
 
 (defun vc-git--out-ok (command &rest args)
   (zerop (apply 'vc-git--call '(t nil) command args)))
-- 
2.24.0.155.gd9f6f3b619


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes
       [not found]     ` <becd4f7d-2824-bf15-932d-b0fb45af12d7@yandex.ru>
@ 2020-01-11  7:48       ` Eli Zaretskii
  2020-01-13  8:35         ` Robert Pluim
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2020-01-11  7:48 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: rpluim, 38688

> Cc: 38688@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sat, 11 Jan 2020 04:38:07 +0300
> 
> On 10.01.2020 17:40, Robert Pluim wrote:
> > True. The attached works for me. emacs-27 or master?
> 
> Looks safe enough to me, but it's up to Eli.

I'm okay with pushing this to the release branch.

Thanks.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes
  2020-01-11  7:48       ` Eli Zaretskii
@ 2020-01-13  8:35         ` Robert Pluim
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Pluim @ 2020-01-13  8:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 38688, Dmitry Gutov

>>>>> On Sat, 11 Jan 2020 09:48:48 +0200, Eli Zaretskii <eliz@gnu.org> said:

    >> Cc: 38688@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
    >> From: Dmitry Gutov <dgutov@yandex.ru>
    >> Date: Sat, 11 Jan 2020 04:38:07 +0300
    >> 
    >> On 10.01.2020 17:40, Robert Pluim wrote:
    >> > True. The attached works for me. emacs-27 or master?
    >> 
    >> Looks safe enough to me, but it's up to Eli.

    Eli> I'm okay with pushing this to the release branch.

Done.

Robert





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-13  8:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-20 14:53 bug#38688: 27.0.50; vc-dir + tramp hangs when there are stashes Robert Pluim
2019-12-20 15:50 ` Dmitry Gutov
2020-01-10 15:40   ` Robert Pluim
     [not found]     ` <becd4f7d-2824-bf15-932d-b0fb45af12d7@yandex.ru>
2020-01-11  7:48       ` Eli Zaretskii
2020-01-13  8:35         ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).