All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Chris Torek <chris.torek@gmail.com>
Cc: Delilah Ashley Wu <delilahwu@linux.microsoft.com>,
	 git@vger.kernel.org, Nils Fahldieck <nils@fahldieck.de>,
	 Patrick Steinhardt <ps@pks.im>,
	Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
	 Delilah Ashley Wu <delilahwu@microsoft.com>,
	 Derrick Stolee <stolee@gmail.com>,
	 Ben Knoble <ben.knoble@gmail.com>,
	 Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	 Jade Lovelace <lists@jade.fyi>,  Glen Choo <glencbz@gmail.com>
Subject: Re: [PATCH v2 0/3] config: read both home and xdg files for --global
Date: Sun, 23 Aug 2026 18:32:51 -0700	[thread overview]
Message-ID: <xmqqo6esti9o.fsf@gitster.g> (raw)
In-Reply-To: <CAPx1GvcDNx4BUPQkVjbKxYLxTJ=StvLC43R0S_2=T0R8NKbZ7w@mail.gmail.com> (Chris Torek's message of "Sun, 23 Aug 2026 05:36:28 -0700")

Chris Torek <chris.torek@gmail.com> writes:

>> Git still reads the XDG config as part of its effective configuration,
>> as shown by listing the configuration without `--global`:
>>     $ git config list --show-scope --show-origin
>>     global  file:/Users/delilah/.config/git/config    xdg.config=true
>>     global  file:/Users/delilah/.gitconfig            home.config=true
>>
>> The documentation, quoted in [1] and [2], states that `--global` should
>> read from both files ...
>
> I have a related question: which of the global file(s) does
>
>     git config --global --edit
>
> edit? Which one(s) should it edit?

I _know_ that having git-config read per-user configuration from
both places was a deliberate design choice to help those who choose
to migrate away from ~/.gitconfig to the XDG layout, while making
sure we do not disrupt those who choose not to migrate.

For the write-out path of "git config --global set var val", we also
chose accordingly, knowing that the majority of users back then had
their per-user configuration in ~/.gitconfig and some, but not
necessarily all, wanted to migrate to the XDG layout, while avoiding
writing the same thing twice to different places.  Therefore, "git
config --global --edit" should follow the choice in the same spirit
as the existing write-out code path (and no, I do not think we want
to open two files in users' editors).

As to the primary focus of this topic, I think "git config --global"
for the read path was not designed as carefully as the write-out
code path or the general "git config" sequence when we introduced
optional support for the XDG layout.  Any discrepancy between "git
config" when reading per-user values (to be overridden further by
per-repository settings) and what "git config --global" reads from
per-user files is very likely not due to any deliberate design
choice, but merely bugs caused by a slip of the mind.

      reply	other threads:[~2026-08-24  1:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10  1:14 [PATCH/RFC 0/4] config: read both home and xdg files for --global Delilah Ashley Wu via GitGitGadget
2025-10-10  1:14 ` [PATCH/RFC 1/4] cleanup_path: force forward slashes on Windows Delilah Ashley Wu via GitGitGadget
2025-11-19 17:47   ` Junio C Hamano
2025-10-10  1:14 ` [PATCH/RFC 2/4] config: test home and xdg files in `list --global` Delilah Ashley Wu via GitGitGadget
2025-11-19 18:29   ` Junio C Hamano
2025-10-10  1:14 ` [PATCH/RFC 3/4] config: read global scope via config_sequence Delilah Ashley Wu via GitGitGadget
2025-11-19 18:39   ` Junio C Hamano
2025-10-10  1:14 ` [PATCH/RFC 4/4] config: keep bailing on unreadable global files Delilah Ashley Wu via GitGitGadget
2025-10-10  1:27 ` [PATCH/RFC 0/4] config: read both home and xdg files for --global Kristoffer Haugsbakk
2025-11-22  1:36   ` Delilah Ashley Wu
2026-01-20 20:41     ` Junio C Hamano
2025-11-17 13:29 ` Johannes Schindelin
2025-11-18  0:28   ` Junio C Hamano
2025-11-19 14:44 ` Junio C Hamano
2025-11-22  2:00   ` Delilah Ashley Wu
2026-08-23 10:28 ` [PATCH v2 0/3] " Delilah Ashley Wu
2026-08-23 10:28   ` [PATCH v2 1/3] path: use forward slashes in XDG config on Windows Delilah Ashley Wu
2026-08-26 17:58     ` Junio C Hamano
2026-09-10  4:48       ` Delilah Ashley Wu
2026-08-23 10:28   ` [PATCH v2 2/3] config: let sequence require a successful file Delilah Ashley Wu
2026-08-26 18:20     ` Junio C Hamano
2026-08-23 10:28   ` [PATCH v2 3/3] config: read global scope via config_sequence Delilah Ashley Wu
2026-08-26 18:38     ` Junio C Hamano
2026-08-23 12:36   ` [PATCH v2 0/3] config: read both home and xdg files for --global Chris Torek
2026-08-24  1:32     ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo6esti9o.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ben.knoble@gmail.com \
    --cc=chris.torek@gmail.com \
    --cc=delilahwu@linux.microsoft.com \
    --cc=delilahwu@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=glencbz@gmail.com \
    --cc=kristofferhaugsbakk@fastmail.com \
    --cc=lists@jade.fyi \
    --cc=nils@fahldieck.de \
    --cc=ps@pks.im \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.