Re: [PATCH] config: fix several access(NULL) calls
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jul 13, 2012, 14:05 UTC
- Message-ID
- <87hatboiwr.fsf@thomas.inf.ethz.ch>
- In-Reply-To
- <vpqliin6bva.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 26 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> On Fri, Jul 13, 2012 at 10:48:18AM +0200, Matthieu Moy wrote:
>>
>>> Junio C Hamano <gitster@pobox.com> writes:
>>>
>>> > But is it really true that we want to error out on missing HOME if
>>> > we have usable XDG stuff?
>>>
>>> Anyone else have an opinion on this?
>>>
>>> In short, the question is whether
>>>
>>> export XDG_CONFIG_HOME=some-existing-dir
>>> unset HOME
>>> git config foo.baz boz
>>>
>>> should die("$HOME is unset") or use the XDG config file.
>>
>> What did previous versions of git do? From my reading of 21cf32279, the
>> previous behavior was that if $HOME was not set, git would silently
>> avoid reading from $HOME/.gitconfig entirely.
>
> Yes, and this is still the case for _reading_. But the current case is
> about deciding which file to use when _writing_. Git was already dying
> when writing with an unset $HOME.Umm, are you sure? I may be somewhat confused about this, but the tests I used to trigger the access(NULL) were IIRC
unset HOME git config --get foo.bar git config --global --get foo.bar
none of which is writing....
--
Thomas Rast
trast@{inf,student}.ethz.ch