Subject: bug#36090: 26.1; Tramp hanging when writing version-controlled file

From: Norman Gray <[email-masked]>
Date: Mon, 10 Jun 2019 11:19:00 +0000

Michael, hello.

I've narrowed down the problem: it's with 'pager=less' in the remote 
.hgrc.  See details below.

To reproduce:

helium:checkouts> mkdir test
helium:checkouts> cd test
helium:test> hg init
helium:test> echo 'This file is version-controlled' >vc.txt
helium:test> echo 'This file is not version-controlled' >vc-no.txt
helium:test> hg add vc.txt
helium:test> hg ci -m"Initial"
helium:test> hg st
? vc-no.txt
helium:~> cat .hgrc
[ui]
username = Norman Gray <[email-masked]>
[pager]
pager = less
helium:~>

Then:

> C-x C-f /scp:helium:checkouts/test/vc.txt

hangs until

> C-g

Then edited this file, and saved it.

> C-x C-s

This again hung until C-g.  The non-version-controlled file, vc-no.txt 
worked as expected.

The contents of the *Messages* and *debug* buffers, with tramp-version 
set to 10, for this case, are attached, in

tramp-notes-messages-4.txt
tramp-notes-debug-4.txt

Then I edit .hgrc:

helium:~> cat .hgrc
[ui]
username = Norman Gray <[email-masked]>
helium:~>

...and edit and save (C-x C-s) vc.txt, and it works.  The contents of 
the *Messages* and *debug* buffers, for this case, are in

tramp-notes-messages-5.txt
tramp-notes-debug-5.txt

As before, this is tramp 2.4.2-pre, in the same git version as before.

The remote version of less is:

> helium:~> less --version
> less 530 (POSIX regular expressions)
> Copyright (C) 1984-2017  Mark Nudelman

My initial pager setting was 'pager = LESS=-FRX less'.  That might be 
overdone (I can't remember offhand why I've selected those options), but 
not particularly unreasonable.  I don't want to simply omit setting from 
my .hgrc.  It might be that amending the remote hg command by adding 
'--config pager.pager=' will override the relevant invocation of remote 
hg -- I haven't tested this.

Thanks for your continued labours here.

Best wishes,

Norman