Re: [PATCH v2 3/4] config: factor out global config file retrieval
- From
Kristoffer Haugsbakk <code@khaugsbakk.name>
- Date
- Jan 16, 2024, 21:46 UTC
- Message-ID
- <c87b3d93-74db-4377-a57c-80f766d46e7f@app.fastmail.com>
- In-Reply-To
- <xmqqcyu1yn36.fsf@gitster.g>
On Tue, Jan 16, 2024, at 22:39, Junio C Hamano wrote:
Show 15 quoted lines
> Kristoffer Haugsbakk <code@khaugsbakk.name> writes: >> char *git_system_config(void); >> +/** >> + * Returns `NULL` if is uncertain whether or not `HOME/.gitconfig` exists. >> + */ > > Sorry, but I am not sure what this comment wants to say. > > When $HOME is not set, we do get NULL out of this function. But > interpolate_path() that makes git_global_config_paths() to return > NULL in user_config does not do any existence check with stat() or > access(), so even when we return a string that is "~/.gitconfig" > expanded to '/home/user/.gitconfig", we are not certain if the file > exists. So,... it is unclear what "uncertain"ty we are talking > about in this case.
I'll delete it. It was an attempt to refer to the comments about "It is unknown if HOME/.gitconfig exists".
Cheers
-- Kristoffer Haugsbakk