display p2pstdio stderr after auth

Display error messages that come from git-annex-shell when the p2p protocol
is used, so that diskreserve messages, IO errors, etc from the remote side
are visible again.

Felt like it should perhaps use outputError, so --json-error-messages would
include these, but as an async IO action, it can't, and this would need
MessageState to be converted to a tvar. Anyway, when not using p2pstdio,
that's not done; nor is it done for stderr from external special remotes
or other commands, so punted on the idea for now.

This commit was sponsored by mo on Patreon.
This commit is contained in:
Joey Hess 2018-06-12 14:57:45 -04:00
parent 90a3afb60f
commit 760f66829a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 64 additions and 10 deletions

View file

@ -1,3 +1,21 @@
`git-annex-shell p2pstdio` hides error messages that were transported over
ssh to display to the user before. For example, diskreserve problems or IO
errors. --[[Joey]]
git-annex discards stderr from the command because old
versions of git-annex-shell don't support the command and error out.
Simply letting stderr through seems like the best solution though,
if a way can be found to do it.
Otherwise, all errors would have to be trapped (easy), and all stderr
output also trapped (hard!), to be sent over the protocol using ERROR.
And, there'd be a problem with sending messages atomically; if a message is
being sent and an exception is thrown, that message needs to somehow be
ended before an ERROR message can be sent.
Hmm, it negotiates the protocol version after opening the connection.
Any error at that point would make it not use the p2p protocol,
so can be excluded. Then, after version negotiation is complete, it
could start displaying stderr.
> [[fixed|done]] --[[Joey]]