all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Noam Postavsky <npostavs@gmail.com>
Cc: Philipp Stephani <p.stephani2@gmail.com>, 41099@debbugs.gnu.org
Subject: bug#41099: 28.0.50; TRAMP process-file ignores exit status of remote process
Date: Thu, 14 May 2020 13:00:44 +0200	[thread overview]
Message-ID: <87a72akcgz.fsf@gmx.de> (raw)
In-Reply-To: <87v9kzl2ga.fsf@gmail.com> (Noam Postavsky's message of "Wed, 13 May 2020 21:39:33 -0400")

Noam Postavsky <npostavs@gmail.com> writes:

Hi Noam,

>>> (defun tramp-process-file (...)
>>>   (let ((code (...original code...)))
>>>     (if (> code 128)
>>>        ;; Probably a signal
>>>        (format "Signal %d" (- code 128))
>>>     code))
>>
>> I've pushed a patch to master along these lines.
>
> I don't think this is sufficiently reliable.  With current master:
>
>     (let ((default-directory "/sudo::/home/npostavs/.emacs.d/"))
>       (process-file "git" nil nil nil "merge-base"))
>     ;=> "Signal 1"
>
>     (let ((default-directory "/home/npostavs/.emacs.d/"))
>       (process-file "git" nil nil nil "merge-base"))
>     ;=> 129

I see. A short test shows, that git is using exit code 129 in case of
error in invocation, although it isn't documented in the man pages.

Hmm, this seems to be a contradiction to the specification of reserved
exit codes, as described in <https://tldp.org/LDP/abs/html/exitcodes.html>.
We cannot change git, so either

- we keep Tramp's process-file implementation as it is,
- we don't return a string in case a signal has interrupted the process,
- we install trap handlers in the remote shell in order to let Tramp
  detect signals reliably.

The last alternative might be the best approach to keep the process-file
spec. But it sounds expensive to me, and people already complain about
Tramp performance. Do we want to go this way?

Best regards, Michael.





  reply	other threads:[~2020-05-14 11:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 18:49 bug#41099: 28.0.50; TRAMP process-file ignores exit status of remote process Philipp Stephani
2020-05-05 19:02 ` Philipp Stephani
2020-05-05 19:25   ` Michael Albinus
2020-05-06  8:38     ` Michael Albinus
2020-05-06 10:38       ` Philipp Stephani
2020-05-06 10:50         ` Philipp Stephani
2020-05-06 11:24           ` Michael Albinus
2020-05-06 13:32             ` Michael Albinus
2020-05-06 15:36               ` Philipp Stephani
2020-05-06 17:30                 ` Michael Albinus
2020-05-06 17:56                   ` Philipp Stephani
2020-05-06 17:57                     ` Philipp Stephani
2020-05-06 19:33                       ` Michael Albinus
2020-05-07  8:29                       ` Michael Albinus
2020-05-09 19:53                         ` Philipp Stephani
2020-05-14  1:39                         ` Noam Postavsky
2020-05-14 11:00                           ` Michael Albinus [this message]
2020-05-14 12:38                             ` Philipp Stephani
2020-05-14 12:50                               ` Andreas Schwab
2020-05-14 14:07                               ` Noam Postavsky
2020-05-14 14:48                                 ` Philipp Stephani
2020-05-14 15:49                                   ` Michael Albinus
2020-05-16 12:06                                     ` Michael Albinus
2020-05-16 12:11                                     ` Dmitry Gutov
2020-05-16 12:19                                       ` Michael Albinus
2020-05-16 22:03                                         ` Dmitry Gutov
2020-05-17  8:19                                           ` Michael Albinus
2020-05-23 19:17                                         ` Philipp Stephani
2020-05-23 19:35                                           ` Michael Albinus
2020-05-23 19:42                                             ` Philipp Stephani
2020-05-06 17:41                 ` Andreas Schwab
2020-05-06 17:53                   ` Philipp Stephani
2020-05-06 18:58                     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a72akcgz.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=41099@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.