All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Kristoffer Haugsbakk <code@khaugsbakk.name>
Cc: git@vger.kernel.org, stolee@gmail.com,
	Eric Sunshine <sunshine@sunshineco.com>,
	Taylor Blau <me@ttaylorr.com>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 3/4] config: factor out global config file retrieval
Date: Fri, 19 Jan 2024 08:59:35 +0100	[thread overview]
Message-ID: <Zaor5zNLKE3UXhHM@tanuki> (raw)
In-Reply-To: <7f0864ad-c846-42a6-8ddc-85d6be58a4ee@app.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]

On Fri, Jan 19, 2024 at 08:40:51AM +0100, Kristoffer Haugsbakk wrote:
> On Fri, Jan 19, 2024, at 07:18, Patrick Steinhardt wrote:
> > But second, I think that the new function you introduce here has the
> > same issue as the old function that you refactored in the preceding
> > patch: `git_config_global()` isn't very descriptive, and it is also
> > inconsistent the new `git_config_global_paths()`. I'd propose to name
> > the new function something like `git_config_global_preferred_path()` or
> > `git_config_global_path()`.
> 
> The choice of `git_config_global` is mostly motivated by it working the
> same way as `git_config_system`:
> 
> ```
> given_config_source.file = git_system_config();
> […]
> given_config_source.file = git_global_config();
> ```
> 
> (The extra logic imposed by XDG for “global” is implied by `man git
> config`. I don’t know what the guidelines are for spelling that out or not
> in the internal functions.)
> 
> Your suggestion makes sense. But should `git_system_config` be renamed as
> well?

Yeah, you're right that `git_system_config()` is bad in the same way. In
fact I think it's worse here because we have both `git_config_system()`
and `git_system_config()`, which has certainly confused me multiple
times in the past. So I'd be happy to see it renamed, as well, either
now or in a follow-up patch series.

But as I said, I don't think it's a prereq for this patch series to land
and others may have differing opinions. So please, go ahead as you deem
fit (or wait for other opinions).

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-19  7:59 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 20:28 [PATCH v1 0/4] maintenance: use XDG config if it exists Kristoffer Haugsbakk
2023-10-18 20:28 ` [PATCH v1 1/4] config: format newlines Kristoffer Haugsbakk
2023-10-18 20:28 ` [PATCH v1 2/4] config: rename global config function Kristoffer Haugsbakk
2023-10-18 20:28 ` [PATCH v1 3/4] config: factor out global config file retrieval Kristoffer Haugsbakk
2023-10-23  9:58   ` Patrick Steinhardt
2023-10-23 17:40     ` [PATCH v1 3/4] config: factor out global config file retrievalync-mailbox> Taylor Blau
2023-10-24 13:23       ` Kristoffer Haugsbakk
2023-10-25  5:38         ` Patrick Steinhardt
2023-10-25  7:33           ` Kristoffer Haugsbakk
2023-10-25  8:05             ` Patrick Steinhardt
2023-10-27 15:54               ` Junio C Hamano
2023-10-18 20:28 ` [PATCH v1 4/4] maintenance: use XDG config if it exists Kristoffer Haugsbakk
2023-10-23  9:58   ` Patrick Steinhardt
2023-10-23 11:39     ` Eric Sunshine
2024-01-14 21:43 ` [PATCH v2 0/4] " Kristoffer Haugsbakk
2024-01-14 21:43   ` [PATCH v2 1/4] config: format newlines Kristoffer Haugsbakk
2024-01-14 21:43   ` [PATCH v2 2/4] config: rename global config function Kristoffer Haugsbakk
2024-01-14 21:43   ` [PATCH v2 3/4] config: factor out global config file retrieval Kristoffer Haugsbakk
2024-01-16 21:39     ` Junio C Hamano
2024-01-16 21:46       ` Kristoffer Haugsbakk
2024-01-19  6:18     ` Patrick Steinhardt
2024-01-19  7:40       ` Kristoffer Haugsbakk
2024-01-19  7:59         ` Patrick Steinhardt [this message]
2024-01-19 23:04           ` Junio C Hamano
2024-01-19 18:36         ` Junio C Hamano
2024-01-19 18:59           ` rsbecker
2024-01-14 21:43   ` [PATCH v2 4/4] maintenance: use XDG config if it exists Kristoffer Haugsbakk
2024-01-16 21:52     ` Junio C Hamano
2024-01-18 16:12 ` [PATCH v3 0/4] " Kristoffer Haugsbakk
2024-01-18 16:12   ` [PATCH v3 1/4] config: format newlines Kristoffer Haugsbakk
2024-01-18 16:12   ` [PATCH v3 2/4] config: rename global config function Kristoffer Haugsbakk
2024-01-18 16:12   ` [PATCH v3 3/4] config: factor out global config file retrieval Kristoffer Haugsbakk
2024-01-18 16:12   ` [PATCH v3 4/4] maintenance: use XDG config if it exists Kristoffer Haugsbakk

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=Zaor5zNLKE3UXhHM@tanuki \
    --to=ps@pks.im \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=stolee@gmail.com \
    --cc=sunshine@sunshineco.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.