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, 17:52 UTC
Message-ID
<vpq61il9vh8.fsf@anie.imag.fr>
In-Reply-To
<xmqqioml732e.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Probably a good idea; I do not think of any possible interactions we
> have to worry about with the configuration file init-db creates with
> possible templating.

The feature should trigger only for --global, so it shouldn't interfer with .git/config and templates.

Show 7 quoted lines
> Do we use "user-wide" as a phrase to refer to these?  It sounds
> somewhat funny to call anything specific to $frotz "$frotz-wide", at
> least to me.
>
> Surely, /etc/gitconfig is called "site-wide".  But .git/config is
> per-project (or project-specific), and I would always have thought
> that ~/.gitconfig was "per-user".

I'm not a native speaker, but to me, "user-wide" insists on the fact that it applies to everything for this user, and "per-user" insists on the fact that it does not apply to other users.

Perhaps just "Git's user configuration file" would be enough.
Show 16 quoted lines
>>  builtin/config.c | 30 +++++++++++++++++++++++++++---
>>  cache.h          |  1 +
>>  ident.c          |  2 +-
>>  3 files changed, 29 insertions(+), 4 deletions(-)
>>
>> diff --git a/builtin/config.c b/builtin/config.c
>> index fcd8474..3821697 100644
>> --- a/builtin/config.c
>> +++ b/builtin/config.c
>> @@ -445,6 +445,20 @@ static int get_urlmatch(const char *var, const char *url)
>>  	return 0;
>>  }
>>  
>> +static char *default_user_config()
>
> static char *default_user_config(void)
Right. Doing too much C++.
Show 8 quoted lines
>> +{
>> +	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"
>
> tangent: is it a French tradition to always have comma after please?

Perhaps. In French, the comma would be required after "S'il vous plait" (litterally, "if you like"). I'll remove it.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C Hamano
Message 13 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.