Re: [PATCH v2 3/4] config: factor out global config file retrieval
- From
Kristoffer Haugsbakk <code@khaugsbakk.name>
- Date
- Jan 19, 2024, 07:40 UTC
- Message-ID
- <7f0864ad-c846-42a6-8ddc-85d6be58a4ee@app.fastmail.com>
- In-Reply-To
- <ZaoUOPsze7rhtT2M@tanuki>
On Fri, Jan 19, 2024, at 07:18, Patrick Steinhardt wrote:
Show 6 quoted lines
> 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?
-- Kristoffer Haugsbakk