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

Re: [PATCH 6/7] trace: disable key after write error

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 4, 2016, 20:45 UTC
Message-ID
<xmqq8twc1cx4.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160803230103.daexq233ufrttnmn@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
> If we get a write error writing to a trace descriptor, the
> error isn't likely to go away if we keep writing. Instead,
> you'll just get the same error over and over. E.g., try:
>
>   GIT_TRACE_PACKET=42 git ls-remote >/dev/null
>
> You don't really need to see:
>
>   warning: unable to write trace for GIT_TRACE_PACKET: Bad file descriptor
>
> hundreds of times. We could fallback to tracing to stderr,
> as we do in the error code-path for open(), but there's not
> much point. If the user fed us a bogus descriptor, they're
> probably better off fixing their invocation. And if they
> didn't, and we saw a transient error (e.g., ENOSPC writing
> to a file), it probably doesn't help anybody to have half of
> the trace in a file, and half on stderr.

Yes, I think I like this better than "we cannot open the named file, so let's trace into standard error stream" that is done in the code in the context of [3/7]. We should do the same over there.

Previous: Jeff KingNext: Jeff King
Message 11 of 20 in “minor trace fixes and cosmetic improvements”
  1. 0/7 minor trace fixes and cosmetic improvementsJeff King, Aug 3, 2016
  2. 2/7 trace: stop using write_or_whine_pipe()Jeff King, Aug 3, 2016
  3. 3/7 trace: use warning() for printing trace errorsJeff King, Aug 3, 2016
  4. Junio C HamanoAug 4, 2016
  5. Jeff KingAug 4, 2016
  6. Junio C HamanoAug 4, 2016
  7. Jeff KingAug 5, 2016
  8. Christian CouderAug 5, 2016
  9. Junio C HamanoAug 5, 2016
  10. 6/7 trace: disable key after write errorJeff King, Aug 3, 2016
  11. Junio C HamanoAug 4, 2016
  12. Jeff KingAug 4, 2016
  13. Jeff KingAug 5, 2016
  14. 7/7 write_or_die: drop write_or_whine_pipe()Jeff King, Aug 3, 2016
  15. 1/7 trace: handle NULL argument in trace_disable()Jeff King, Aug 3, 2016
  16. Jeff KingAug 3, 2016
  17. 4/7 trace: cosmetic fixes for error messagesJeff King, Aug 3, 2016
  18. Junio C HamanoAug 4, 2016
  19. Jeff KingAug 5, 2016
  20. 5/7 trace: correct variable name in write() error messageJeff King, Aug 3, 2016

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.