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

Re: [RFC PATCH 1/3] config --global --edit: create a template file if needed

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 25, 2014, 16:01 UTC
Message-ID
<vpqtx65ctqm.fsf@anie.imag.fr>
In-Reply-To
<CAPig+cSyLtUmkxAcO+iatKSS2t2T5byXRrJYq=MSuBoZ3m=hcw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 12 quoted lines
>> +static char *default_user_config()
>> +{
>> +       struct strbuf buf = STRBUF_INIT;
>> +       strbuf_addf(&buf,
>> +                   _("# This is Git's user-wide configuration file.\n"
>> +                     "[core]\n"
>> +                     "# Please, adapt and uncomment the following lines:\n"
>> +                     "#        user = %s\n"
>> +                     "#        email = %s\n"),
>
> "[core]", "user =", "email =" should not be translated. Would it make
> sense to keep these outside of _()?

I would say no, as the code and the string to translate would be much less readable without core, user and email inline.

Were you suggesting stg like
_("# This is Git's user-wide configuration file.\n"
  "[%s]\n"
  "# Please, adapt and uncomment the following lines:\n"
  "#        %s = %s\n"
  "#        %s = %s\n"),
  "core", "name", ..., "email", ...
?
Show 5 quoted lines
>> +                       if (fd) {
>> +                               char *content = default_user_config();
>> +                               write_str_in_full(fd, content);
>
> close(fd);
Indeed.
Show 7 quoted lines
>> +                               free(content);
>> +                       }
>> +                       else if (errno != EEXIST)
>> +                               die_errno(_("Cannot create configuration file %s"), config_file);
>
> Other error messages in this file (including those just above this
> block) begin with a lowercase letter.
Applied.
Thanks,
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Eric SunshineNext: Eric Sunshine
Message 9 of 13 in “config --global --edit: create a template file if needed”
  1. 1/3 config --global --edit: create a template file if neededMatthieu Moy, Jul 25, 2014
  2. 2/3 home_config_path: allow NULL xdg parameterMatthieu Moy, Jul 25, 2014
  3. Tanay AbhraJul 25, 2014
  4. Junio C HamanoJul 25, 2014
  5. Matthieu MoyJul 25, 2014
  6. 3/3 commit: advertize config --global --edit on guessed identityMatthieu Moy, Jul 25, 2014
  7. Eric SunshineJul 25, 2014
  8. Eric SunshineJul 25, 2014
  9. Matthieu MoyJul 25, 2014
  10. Eric SunshineJul 25, 2014
  11. Junio C HamanoJul 25, 2014
  12. Junio C HamanoJul 25, 2014
  13. Matthieu MoyJul 25, 2014

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.