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

Re: [PATCH v2] CodingGuidelines: a handful of error message guidelines

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 28, 2024, 09:28 UTC
Message-ID
<xmqq34jbogg3.fsf@gitster.g>
In-Reply-To
<CAPig+cSXGreymhni_J8TZ56rp+VZB_Z7ekaRtwFdxE3a2QWS5w@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
>> + - Unless there is a compelling reason not to, error messages from the
>> +   Porcelain command should be marked for `_("translation")`.
>
> Here you capitalize "Porcelain" but below, "plumbing" is all lowercase.

;-) I think that is how we spell them in our documentation when we contrast them against each other.

Show 16 quoted lines
>> + - Error messages from the plumbing commands are sometimes meant for
>> +   machine consumption and should not be marked for `_("translation")`
>> +   to keep them 'grep'-able.
>
> Using the same example, `_("translation")`, for both the "should be"
> and "should not be" cases may very well confuse readers. (It certainly
> confused me.) Perhaps mirroring the example of an item earlier in the
> list would be clearer:
>
>     - Unless there is a compelling reason not to, error messages from
>       porcelain commands should be marked for translation, e.g.
>       `die(_("bad revision"))`
>
>     - Error messages from plumbing commands are sometimes meant for
>       machine consumption, thus should not be marked for translation,
>       e.g. `die("bad revision")`

Thanks, that is much better. Let me steal it verbatim in the hopefully final reroll.

Show 7 quoted lines
>> + - BUG("message") are for communicating the specific error to
>> +   developers, and not to be translated.
>
> Okay, although could be slightly more explicit:
>
>     - BUG("message") is for communicating a specific failure to
>       developers, not end-users, thus should not be translated.

The way I read your rewrite is that the "communitation" mentioned is between the program and the user who saw the message. I wanted to say that the message is seen first by an end-user, and then is communicated to developers. And not translating is one way to make sure the message is not mangled, and stays grep-able, during the game of telephone.

Would this work better?
  - In order to help the user who saw BUG("message") to accurately
    communicate it to developers, do not mark them for translation.
Thanks.
Previous: Eric SunshineNext: Eric Sunshine
Message 13 of 14 in “fast-import: disallow "." and ".." path components”
  1. fast-import: disallow "." and ".." path componentsElijah Newren via GitGitGadget, Nov 25, 2024
  2. Eric SunshineNov 25, 2024
  3. Elijah NewrenNov 25, 2024
  4. fast-import: disallow "." and ".." path componentsElijah Newren via GitGitGadget, Nov 25, 2024
  5. Patrick SteinhardtNov 26, 2024
  6. Jeff KingNov 27, 2024
  7. Junio C HamanoNov 27, 2024
  8. Kristoffer HaugsbakkNov 27, 2024
  9. Re* [PATCH v2] fast-import: disallow "." and ".." path componentsJunio C Hamano, Nov 27, 2024
  10. Eric SunshineNov 27, 2024
  11. CodingGuidelines: a handful of error message guidelinesJunio C Hamano, Nov 28, 2024
  12. Eric SunshineNov 28, 2024
  13. Junio C HamanoNov 28, 2024
  14. Eric SunshineNov 28, 2024

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.