git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	Thomas Rast <trast@student.ethz.ch>
Subject: Re: [PATCH 1/2] transport-helper: report errors properly
Date: Thu, 11 Apr 2013 12:18:45 -0400	[thread overview]
Message-ID: <20130411161845.GA665@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMP44s02K5ydKLNi0umMkuAicoVTWyCdVfjs0yssCa2oyFShGQ@mail.gmail.com>

On Thu, Apr 11, 2013 at 08:22:26AM -0500, Felipe Contreras wrote:

> > We
> > currently do so robustly when the helper uses the "done"
> > feature (and that is what we test).  We cannot do so
> > reliably when the helper does not use the "done" feature,
> > but it is not even worth testing; the right solution is for
> > the helper to start using "done".
> 
> This doesn't help anyone, and it's not even accurate. I think it might
> be possible enforce remote-helpers to implement the "done" feature,
> and we might want to do that later. But of course, discussing what bad
> things remote-helpers could do, and how we should test and babysit
> them is not relevant here.
> 
> If it was important to explain the subtleties and reasoning behind
> this change, it should be a separate patch.

I am OK with adding the test for import as a separate patch. What I am
not OK with (and this goes for the rest of the commit message, too) is
failing to explain any back-story at all for why the change is done in
the way it is.

_You_ may understand it _right now_, but that is not the primary
audience of the message. The primary audience is somebody else a year
from now who is wondering why this patch was done the way it was. When
they are trying to find out why git does not detect errors in a helper,
and they notice that our test for failure only check the "done" case,
isn't it more helpful to say "we considered the other case, but it was
not worth fixing" rather than leaving them to guess?

I may be more verbose than necessary in some of my commit messages, but
I would much rather err on the side of explaining too much than too
little.

> >         export)
> > +               if test -n "$GIT_REMOTE_TESTGIT_FAILURE"
> > +               then
> > +                       # consume input so fast-export doesn't get SIGPIPE;
> 
> I think this is explanation enough.
> 
> > +                       # git would also notice that case, but we want
> > +                       # to make sure we are exercising the later
> > +                       # error checks
> 
> I don't understand what is being said here. What is "that case"?

The case that fast-export gets SIGPIPE. I was trying to explain not
just _what_ we are doing, but _why_ it is important. Perhaps a better
wording would be:

  # consume input so fast-export doesn't get SIGPIPE;
  # we do not technically need to do so in order for
  # git to notice the failure to export, as it will
  # detect problems either with fast-export or with
  # the helper failing to report ref status. But since
  # we are trying to demonstrate that the latter
  # check works, we must avoid the SIGPIPE, which would
  # trigger the former.

-Peff

  reply	other threads:[~2013-04-11 16:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 14:40 [PATCH v4] transport-helper: report errors properly Felipe Contreras
2013-04-08 18:20 ` Sverre Rabbelier
2013-04-08 19:30   ` Jeff King
2013-04-08 19:28 ` Jeff King
2013-04-09 21:38 ` Thomas Rast
2013-04-09 21:50   ` Jeff King
2013-04-10 21:13 ` [PATCH v5 0/2] reporting transport helper errors Jeff King
2013-04-10 21:15   ` [PATCH 1/2] transport-helper: report errors properly Jeff King
2013-04-10 21:22     ` Sverre Rabbelier
2013-04-10 21:46     ` Eric Sunshine
2013-04-11 13:22     ` Felipe Contreras
2013-04-11 16:18       ` Jeff King [this message]
2013-04-11 16:49         ` Felipe Contreras
2013-04-11 16:59           ` Jeff King
2013-04-11 17:57             ` Felipe Contreras
2013-04-11 18:49               ` Junio C Hamano
2013-04-11 21:35                 ` Felipe Contreras
2013-04-11 18:44       ` Junio C Hamano
2013-04-11 21:21         ` Felipe Contreras
2013-04-11 23:05           ` Junio C Hamano
2013-04-13  5:42             ` Felipe Contreras
2013-04-13  6:00               ` Jeff King
2013-04-13  6:43                 ` Felipe Contreras
2013-04-14  5:23                   ` Junio C Hamano
2013-04-14 15:54                     ` Felipe Contreras
2013-04-10 21:16   ` [PATCH 2/2] transport-helper: mention helper name when it dies Jeff King
2013-04-10 21:23     ` Sverre Rabbelier
2013-04-10 21:28       ` Jeff King
2013-04-10 21:35         ` Sverre Rabbelier
2013-04-10 23:13 ` [PATCH v4] transport-helper: report errors properly rh
2013-04-11  3:39   ` Jeff King

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=20130411161845.GA665@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=srabbelier@gmail.com \
    --cc=trast@student.ethz.ch \
    /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.
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 NNTP newsgroup(s).