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

Re: [PATCH 1/4] usage.c: add a die_message() routine

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 6, 2021, 19:46 UTC
Message-ID
<xmqqa6hdfreu.fsf@gitster.g>
In-Reply-To
<xmqqee6pfrkd.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> It also makes readers wonder why this is not
>
> 	exit(die_message(err, params));
>
> which I take it a sign that this new API is overly loose to allow a
> simple single thing to be done in multiple ways.  Perhaps as the
> series progresses, the picture might improve, but if that is the
> case, perhaps the presentation order needs to be rethought.
> E.g. start without the _builtin that implies override-ability,
> convert the existing code that can benefit from calling die_message(),
> and then finally introduce _builtin that is merely an implementation
> detail, or something like that, perhaps?
>
> In any case, the first step in this four patch series is not enough
> to evaluate if this step makes sense, so let's keep reading.

OK, it is the other way around. This step with _builtin is incomplete introduction of the API, even though it was "we add the new API function without having any meaningful callers, because combining them together into a single patch is too much to chew in a single sitting". A small part of 2/4 that adds the override-able die_message_routine should be part of this step to make this step understandable.

THanks.
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 6 of 22 in “usage API: Add and use die_message()”
  1. 0/4 usage API: Add and use die_message()Ævar Arnfjörð Bjarmason, Dec 6, 2021
  2. 2/4 usage.c API users: use die_message() where appropriateÆvar Arnfjörð Bjarmason, Dec 6, 2021
  3. Junio C HamanoDec 6, 2021
  4. 1/4 usage.c: add a die_message() routineÆvar Arnfjörð Bjarmason, Dec 6, 2021
  5. Junio C HamanoDec 6, 2021
  6. Junio C HamanoDec 6, 2021
  7. 4/4 config API: don't use vreportf(), make it static in usage.cÆvar Arnfjörð Bjarmason, Dec 6, 2021
  8. Junio C HamanoDec 6, 2021
  9. Ævar Arnfjörð BjarmasonDec 7, 2021
  10. 3/4 usage.c + gc: add and use a die_message_errno()Ævar Arnfjörð Bjarmason, Dec 6, 2021
  11. Junio C HamanoDec 6, 2021
  12. 0/6 usage API: Add and use die_message()Ævar Arnfjörð Bjarmason, Dec 7, 2021
  13. 1/6 usage.c: add a die_message() routineÆvar Arnfjörð Bjarmason, Dec 7, 2021
  14. 2/6 usage.c API users: use die_message() for "fatal :" + exit 128Ævar Arnfjörð Bjarmason, Dec 7, 2021
  15. 3/6 usage.c API users: use die_message() for error() + exit 128Ævar Arnfjörð Bjarmason, Dec 7, 2021
  16. 4/6 gc: return from cmd_gc(), don't call exit()Ævar Arnfjörð Bjarmason, Dec 7, 2021
  17. 5/6 usage.c + gc: add and use a die_message_errno()Ævar Arnfjörð Bjarmason, Dec 7, 2021
  18. 6/6 config API: use get_error_routine(), not vreportf()Ævar Arnfjörð Bjarmason, Dec 7, 2021
  19. Junio C HamanoDec 7, 2021
  20. Jonathan TanDec 22, 2021
  21. Junio C HamanoDec 22, 2021
  22. Ævar Arnfjörð BjarmasonDec 24, 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.