git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fallback on getpwuid if envar HOME is unset

From
Jeff King <peff@peff.net>
Date
Aug 21, 2012, 19:40 UTC
Message-ID
<20120821194049.GB15667@sigill.intra.peff.net>
In-Reply-To
<7vvcgccaol.fsf@alter.siamese.dyndns.org>
On Tue, Aug 21, 2012 at 12:22:18PM -0700, Junio C Hamano wrote:
Show 22 quoted lines
> Conley Owens <cco3@android.com> writes:
> 
> > Yes, that's the upstart I'm referring to.  This makes sense.  However, it's a
> > confusing situation to run into.  Would a warning about an unset $HOME be
> > appropriate?
> 
> Unsetting HOME is an easy way to skip what is in ~/.gitconfig when
> helping other people on this list, and I wouldn't mind such a
> warning while I knowingly unset it, I can imagine other helpful
> people may find such a warning irritating and complain "I know I do
> not have $HOME set, as I earlier explicitly did unset it myself!".
> 
> So, I am on the fence on this one, but because
> 
>  (1) no warning would mean upstart scripts writers need to be aware
>      of lack of $HOME, but they need to be aware of it for reasons
>      unrelated to Git anyway; and
> 
>  (2) a warning while trying vanilla Git behaviour to help others
>      might be irritating, it is not an every day use anyway.
> 
> I do not think it matters either way in practice.

I do not use upstart, but presumably it logs the stderr of jobs it runs. Which means that a warning about unset $HOME would help debugging for people who care about looking in ~/.gitconfig, but would become a noisy nuisance for people whose jobs did not care.

Personally, I think it would be much friendlier of upstart to give the user's jobs a sane minimal environment. That is what cron has always done, setting HOME, LOGNAME, and SHELL. But that is my uninformed 5-second opinion as a long-time Unix user; I have not looked at upstart at all, so perhaps there is some argument I haven't seen.

-Peff
Previous: Junio C HamanoNext: Andreas Schwab
Message 7 of 9 in “Fallback on getpwuid if envar HOME is unset”
  1. Fallback on getpwuid if envar HOME is unsetConley Owens, Aug 21, 2012
  2. Jeff KingAug 21, 2012
  3. Conley OwensAug 21, 2012
  4. Junio C HamanoAug 21, 2012
  5. Conley OwensAug 21, 2012
  6. Junio C HamanoAug 21, 2012
  7. Jeff KingAug 21, 2012
  8. Andreas SchwabAug 21, 2012
  9. Junio C HamanoAug 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.