From: Junio C Hamano <gitster@pobox.com>
To: Conley Owens <cco3@android.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH] Fallback on getpwuid if envar HOME is unset
Date: Tue, 21 Aug 2012 11:22:32 -0700 [thread overview]
Message-ID: <7vzk5ocdg7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAFFUb6UypNJ-8p8Hs14+QMGeU3KSG+pQX7NJTeh3OtBoTZoO3g@mail.gmail.com> (Conley Owens's message of "Tue, 21 Aug 2012 10:18:25 -0700")
Conley Owens <cco3@android.com> writes:
> On Mon, Aug 20, 2012 at 7:30 PM, Jeff King <peff@peff.net> wrote:
>> On Mon, Aug 20, 2012 at 06:28:57PM -0700, Conley Owens wrote:
>>
>>> From f64ba3c908b33a2ea5a5ad1f0e5800af76b82ce9 Mon Sep 17 00:00:00 2001
>>> From: Conley Owens <cco3@android.com>
>>> Date: Mon, 20 Aug 2012 18:23:40 -0700
>>> Subject: [PATCH] Fallback on getpwuid if envar HOME is unset
>>
>> Please drop these lines from the message body; they are redundant with
>> your email's headers.
>>
>> This seems sensible on the surface, but I'm a bit curious: why isn't
>> $HOME set? And are there any reasons that somebody who has unset HOME
>> would not want to fallback? For example, running under Apache, HOME is
>> often unset when calling CGI programs. Would it make sense for us to
>> look in ~www-data/.gitconfig in that case?
>
> I think it might, but perhaps I'm wrong. As another example, upstart strips all
> the environment variables, so if you run a job as a particular user, that user's
> .gitconfig will not be read unless HOME is specified.
Do you mean upstart as the "replacement init.d mechanism"? If that
is the case, the responsibility to set up HOME was moved to the
scripts by upstart if they rely on having a sane value in $HOME; I
do not see it as Git's problem, as it is not the only program that
looks at and acts on the value of $HOME [*1*].
Where do shells (e.g. bash and dash) go when you say "cd" without
parameter when $HOME is unset, for example? I do not think they
magically read from getpwent() and use the value from there to fill
the $HOME's place. We should follow suit.
[Footnote]
*1* I further have to suspect that enough scripts would be
inconvenienced by such a (mis)feature in upstart that over time the
environment scrubbing may have to be rethought in upstart, and at
that point, this entire discussion would become moot.
next prev parent reply other threads:[~2012-08-21 18:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 1:28 [PATCH] Fallback on getpwuid if envar HOME is unset Conley Owens
2012-08-21 2:30 ` Jeff King
2012-08-21 17:18 ` Conley Owens
2012-08-21 18:22 ` Junio C Hamano [this message]
2012-08-21 18:33 ` Conley Owens
2012-08-21 19:22 ` Junio C Hamano
2012-08-21 19:40 ` Jeff King
2012-08-21 18:41 ` Andreas Schwab
2012-08-21 3:54 ` Junio C Hamano
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=7vzk5ocdg7.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=cco3@android.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).