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

Re: [PATCH 2/5] merge-recursive: porcelain messages for checkout

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 9, 2010, 21:15 UTC
Message-ID
<AANLkTikQAduZ3=1U6ObzLKdY0pomMBm2BGbq+Xyfmggh@mail.gmail.com>
In-Reply-To
<vpq4of3se4v.fsf@bauges.imag.fr>
On Mon, Aug 9, 2010 at 20:52, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 19 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>>
>>> +void set_porcelain_error_msgs(const char **msgs, const char *cmd)
>>>  {
>>> +    const char *msg;
>>> +    char *tmp;
>>> +    const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";
>>
>> This may have implications to the later i18n effort, but lets ignore it
>> for now.  I don't think it will be too bad.
>
> Note that the ? : construct just allows factoring out two messages,
> but one can easily distinguish all cases and give the complete error
> message in the source (we don't care about performance/memory here,
> it's a one-time thing).
>
> So, yes, that's easily fixable later if it causes problems to i18n.

Yeah, this is a drop in the lego ocean that is Git's source code. Don't worry about it, it can be fixed later.

You can stop reading at this point.

FWIW "lego" is the i18n term used for printf("messages %s assembled like this", "that are"). E.g.:

    printf(_("It's a nice %s"), is_evening() ? _("evening") : _("day"));

Things like that will cause trouble for e.g. French where it's "C'est un soirée formidable." or "C'est un jour formidable." (I hope I got that right). You can move the %s around, but it's still hard to translate stuff like that, especially as translation programs often display strings independently.

It's better to have independent strings like _("It's a nice evening") and _("It's a nice day") instead, even if it leads to duplication.

I'll be submitting a lot of patches to fix things like this once the i18n series gets merged.

Have fun.
Previous: Matthieu MoyNext: Matthieu Moy
Message 13 of 16 in “Better error messages for checkout and merge.”
  1. 0/5 Better error messages for checkout and merge.Matthieu Moy, Aug 9, 2010
  2. 1/5 Turn unpack_trees_options.msgs into an array + enumMatthieu Moy, Aug 9, 2010
  3. Junio C HamanoAug 9, 2010
  4. Matthieu MoyAug 9, 2010
  5. 1/5 Turn unpack_trees_options.msgs into an array + enumMatthieu Moy, Aug 11, 2010
  6. 2/5 merge-recursive: porcelain messages for checkoutMatthieu Moy, Aug 11, 2010
  7. 3/5 merge-recursive: distinguish "removed" and "overwritten" messagesMatthieu Moy, Aug 11, 2010
  8. 4/5 unpack_trees: group error messages by typeMatthieu Moy, Aug 11, 2010
  9. 5/5 t7609: test merge and checkout error messagesMatthieu Moy, Aug 11, 2010
  10. 2/5 merge-recursive: porcelain messages for checkoutMatthieu Moy, Aug 9, 2010
  11. Junio C HamanoAug 9, 2010
  12. Matthieu MoyAug 9, 2010
  13. Ævar Arnfjörð BjarmasonAug 9, 2010
  14. 3/5 merge-recursive: distinguish "removed" and "overwritten" messagesMatthieu Moy, Aug 9, 2010
  15. 4/5 unpack_trees: group error messages by typeMatthieu Moy, Aug 9, 2010
  16. 5/5 t7609: test merge and checkout error messagesMatthieu Moy, Aug 9, 2010

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.