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

Re: Git config multiple values

From
Andreas Heiduk <asheiduk@gmail.com>
Date
Oct 6, 2017, 18:58 UTC
Message-ID
<962cbecd-4be1-f041-30e3-cc4cd19310d0@gmail.com>
In-Reply-To
<20171006172530.GV19555@aiede.mtv.corp.google.com>
Hi,
Am 06.10.2017 um 19:25 schrieb Jonathan Nieder:
Show 15 quoted lines
> Hi,
> 
> Jeff King wrote:
>> On Fri, Oct 06, 2017 at 01:10:17PM +0200, aleksander.baranowski wrote:
> 
>>> It's just an opinion, but this behaviour is no consistent for me.
>>>
>>> If it's not the bug it's a feature just let me know.
>>
>> It's a feature, though I agree that git-config is rather baroque. We're
>> mostly stuck with it for reasons of backwards compatibility, though.
> 
> This feels like a dodge.  Can we make a list of what is baroque here,
> with an eye to fixing it?  E.g. if we introduce a new --set option,
> then what should its semantics be, to be more intuitive?
My reading of the manual for 
	git config --global user.name Foo2 Bar
is this:
       Multiple lines can be added to an option by using the --add option.
Does not apply here - no `--add` option, so no new value should be added.
       If you want to update or unset an option which can occur on multiple
       lines, a POSIX regexp value_regex needs to be given. 
does not apply: First: no "--unset" variant is used here leaving only "update".
Second: before that command there is only one value.
       Only the existing values that match the regexp are updated or unset.

Since "Two" does not match the previous value and `update` is the only described case left I'd expect that the command changes nothing.I don't understand how the description allows `git config` to add a new value, because the manual talks about "update" twice, nothing about adding.

Confused --Andreas

Previous: Jeff King
Message 6 of 6 in “Git config multiple values”
  1. aleksander.baranowskiOct 6, 2017
  2. Jeff KingOct 6, 2017
  3. aleksander.baranowskiOct 6, 2017
  4. Jonathan NiederOct 6, 2017
  5. Jeff KingOct 6, 2017
  6. Andreas HeidukOct 6, 2017

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.