git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] transport-helper: report errors properly

From
Jeff King <peff@peff.net>
Date
Apr 11, 2013, 16:18 UTC
Message-ID
<20130411161845.GA665@sigill.intra.peff.net>
In-Reply-To
<CAMP44s02K5ydKLNi0umMkuAicoVTWyCdVfjs0yssCa2oyFShGQ@mail.gmail.com>
On Thu, Apr 11, 2013 at 08:22:26AM -0500, Felipe Contreras wrote:
Show 15 quoted lines
> > 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.

Show 12 quoted lines
> >         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
Previous: Felipe ContrerasNext: Felipe Contreras
Message 12 of 31 in “transport-helper: report errors properly”
  1. transport-helper: report errors properlyFelipe Contreras, Apr 8, 2013
  2. Sverre RabbelierApr 8, 2013
  3. Jeff KingApr 8, 2013
  4. Jeff KingApr 8, 2013
  5. Thomas RastApr 9, 2013
  6. Jeff KingApr 9, 2013
  7. 0/2 reporting transport helper errorsJeff King, Apr 10, 2013
  8. 1/2 transport-helper: report errors properlyJeff King, Apr 10, 2013
  9. Sverre RabbelierApr 10, 2013
  10. Eric SunshineApr 10, 2013
  11. Felipe ContrerasApr 11, 2013
  12. Jeff KingApr 11, 2013
  13. Felipe ContrerasApr 11, 2013
  14. Jeff KingApr 11, 2013
  15. Felipe ContrerasApr 11, 2013
  16. Junio C HamanoApr 11, 2013
  17. Felipe ContrerasApr 11, 2013
  18. Junio C HamanoApr 11, 2013
  19. Felipe ContrerasApr 11, 2013
  20. Junio C HamanoApr 11, 2013
  21. Felipe ContrerasApr 13, 2013
  22. Jeff KingApr 13, 2013
  23. Felipe ContrerasApr 13, 2013
  24. Junio C HamanoApr 14, 2013
  25. Felipe ContrerasApr 14, 2013
  26. 2/2 transport-helper: mention helper name when it diesJeff King, Apr 10, 2013
  27. Sverre RabbelierApr 10, 2013
  28. Jeff KingApr 10, 2013
  29. Sverre RabbelierApr 10, 2013
  30. rhApr 10, 2013
  31. Jeff KingApr 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.