Re: Mark remote `gc --auto` error messages

5 messages, 3 authors, 2016-06-16 · open the first message on its own page

Re: Mark remote `gc --auto` error messages

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:42

Lukas Fleischer [off-list ref] writes:
When running `git push`, it might occur that error messages are
transferred from the server to the client. While most messages (those
explicitly sent on sideband 2) are prefixed with "remote:", it seems
that error messages printed during the automatic householding performed
by git-gc(1) are displayed without any additional decoration. Thus, such
messages can easily be misinterpreted as git-gc failing locally, see [1]
for an actual example of where that happened.
Sounds like a sensible goal to me.

Re: Mark remote `gc --auto` error messages

From: Lukas Fleischer <hidden>
Date: 2016-06-16 02:19:42

On Thu, 02 Jun 2016 at 21:33:33, Junio C Hamano wrote:
Lukas Fleischer [off-list ref] writes:
quoted
When running `git push`, it might occur that error messages are
transferred from the server to the client. While most messages (those
explicitly sent on sideband 2) are prefixed with "remote:", it seems
that error messages printed during the automatic householding performed
by git-gc(1) are displayed without any additional decoration. Thus, such
messages can easily be misinterpreted as git-gc failing locally, see [1]
for an actual example of where that happened.
Sounds like a sensible goal to me.
What exactly are you referring to (you only quoted the introduction)?
Do you think we should fix the git-gc issue but keep the general
behavior of printing messages unaltered? Do you think it would be
worthwhile to make server messages distinguishable in general?

Re: Mark remote `gc --auto` error messages

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:42

On Thu, Jun 2, 2016 at 1:06 PM, Lukas Fleischer [off-list ref] wrote:
On Thu, 02 Jun 2016 at 21:33:33, Junio C Hamano wrote:
quoted
Lukas Fleischer [off-list ref] writes:
quoted
When running `git push`, it might occur that error messages are
transferred from the server to the client. While most messages (those
explicitly sent on sideband 2) are prefixed with "remote:", it seems
that error messages printed during the automatic householding performed
by git-gc(1) are displayed without any additional decoration. Thus, such
messages can easily be misinterpreted as git-gc failing locally, see [1]
for an actual example of where that happened.
Sounds like a sensible goal to me.
What exactly are you referring to (you only quoted the introduction)?
Do you think we should fix the git-gc issue but keep the general
behavior of printing messages unaltered? Do you think it would be
worthwhile to make server messages distinguishable in general?
The latter, which I think was what your implementation was attempting to do
if I read it correctly.

Re: Mark remote `gc --auto` error messages

From: Jeff King <hidden>
Date: 2016-06-16 02:19:42

On Thu, Jun 02, 2016 at 01:14:02PM -0700, Junio C Hamano wrote:
On Thu, Jun 2, 2016 at 1:06 PM, Lukas Fleischer [off-list ref] wrote:
quoted
On Thu, 02 Jun 2016 at 21:33:33, Junio C Hamano wrote:
quoted
Lukas Fleischer [off-list ref] writes:
quoted
When running `git push`, it might occur that error messages are
transferred from the server to the client. While most messages (those
explicitly sent on sideband 2) are prefixed with "remote:", it seems
that error messages printed during the automatic householding performed
by git-gc(1) are displayed without any additional decoration. Thus, such
messages can easily be misinterpreted as git-gc failing locally, see [1]
for an actual example of where that happened.
Sounds like a sensible goal to me.
What exactly are you referring to (you only quoted the introduction)?
Do you think we should fix the git-gc issue but keep the general
behavior of printing messages unaltered? Do you think it would be
worthwhile to make server messages distinguishable in general?
The latter, which I think was what your implementation was attempting to do
if I read it correctly.
I think the implementation is doing much more, but it is probably a good
thing.

Right now we do not send auto-gc output over the sideband, and its
stderr goes to receive-pack's stderr. But that is a different place for
different protocols. For git-over-https, it is probably apache's error
log, or /dev/null if the server admin configured it. For ssh, it may be
back over the ssh stderr channel, or it may go to a log or nowhere if
the server admin intercepts receive-pack and redirects it.

So the greater question is not "should this output be marked" but
"should auto-gc data go over the sideband so that all clients see it
(and any server-side stderr does not)". And I think the answer is
probably yes. And that fixes the "remote: " thing as a side effect.

If it were no, then this is not the right solution, and the solution is
to swap out copy_to_sideband() for something that copies to stderr with
"remote: " prepended, or something.

-Peff

Re: Mark remote `gc --auto` error messages

From: Jeff King <hidden>
Date: 2016-06-16 02:19:42

On Thu, Jun 02, 2016 at 01:14:02PM -0700, Junio C Hamano wrote:
quoted
What exactly are you referring to (you only quoted the introduction)?
Do you think we should fix the git-gc issue but keep the general
behavior of printing messages unaltered? Do you think it would be
worthwhile to make server messages distinguishable in general?
The latter, which I think was what your implementation was attempting to do
if I read it correctly.
And btw, I don't think this patch fixes the general case. E.g., if
receive-pack hits any of its die("BUG") lines, they will not be
prefixed. Most clients wouldn't see them, but ssh ones would.

To fix that you'd have to do a whole async process wrapping
`receive-pack` that just reads its stdout and stderr and muxes it back
over the sideband. But I can think of two roadblocks there:

  - I think the original design of receive-pack was _not_ to share all
    of stderr with the user, because it might contain secret-ish
    server-side things. That's why we have rp_error() which copies to
    the sideband.

    I don't know how useful that is in practice. We copy the stderr
    wholesale from sub-processes like index-pack, so things like file
    paths are likely to get leaked there.

  - the implementation is a bit tricky, because the die() will take
    down the mux thread, too.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help