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

Re: [PATCH] pkt-line: do not report packet write errors twice

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2021, 20:32 UTC
Message-ID
<xmqqlf9jp9v5.fsf@gitster.g>
In-Reply-To
<CAHd-oW4sqJpeJywgRJCkchX0uZFSxD-UnguRJcRcQQywd+scbA@mail.gmail.com>
Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:
> Nice! :) Maybe we could also avoid the static strings without
> repeating the literals by making `do_packet_write()` receive a `struct
> strbuf *err` and save the error message in it? Then the two callers
> can decide whether to pass it to error() or die() accordingly.

Sorry, but I do not understand what benefit we are trying to gain by introducing an extra strbuf (which I assume is used to strbuf_add() the error message into). Wouldn't the caller need two messages and flip between <error,error_errno> vs <die,die_errno> pair?

Previous: Matheus Tavares BernardinoNext: Matheus Tavares
Message 4 of 8 in “pkt-line: do not report packet write errors twice”
  1. pkt-line: do not report packet write errors twiceMatheus Tavares, Apr 15, 2021
  2. Junio C HamanoApr 15, 2021
  3. Matheus Tavares BernardinoApr 15, 2021
  4. Junio C HamanoApr 15, 2021
  5. Matheus TavaresApr 15, 2021
  6. Junio C HamanoApr 15, 2021
  7. pkt-line: do not report packet write errors twiceMatheus Tavares, Apr 15, 2021
  8. Junio C HamanoApr 15, 2021

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.