Jonathan Nieder <> wrote:

> I'm not sure whether to keep 96b9e0e (config: treat user and xdg
> config permission problem as errors) in the long run, BTW.
> Insights welcome.

For what it's worth, here's an anecdote about this:

I work on some open source software which includes a web-based repository 
browser for Git, somewhat similar to gitweb. We implement this partially by 
executing `git` commands from the webserver (usually Apache). For example, we 
run `git cat-file …` to retrieve file content to show to the user.

After this change, a number of users who manage installs of the software are 
hitting "fatal: unable to access '/root/.config/git/config': Permission denied" 
while browsing repositories, because their Apache runs as some unprivileged 
user (like "apache" or "www-data") but with HOME=/root. We've seen about half a 
dozen reports of this now, so I believe this sort of setup is at least somewhat 
common and not just a bizarre one-off user with a broken environment. Users 
generally have difficulty resolving this error on their own, as it's not 
obvious that this boils down to an Apache environmental issue.

We'll likely resolve this by running `HOME=/ git ...` instead of `git ...` when 
we execute commands (or some more finessed version of that, but basically 
pointing HOME at some dummy readable directory). From cursory investigation, it 
appears we can't avoid this fatal with more surgical settings like GIT_CONFIG 
or XDG_CONFIG_HOME, since git still ends up looking in HOME and fataling 
anyway. This fix is a bit clunky, but not really a big deal.

I imagine our use case is fairly unusual, but I wanted to relate it in case 
it's helpful in balancing concerns here. If I've missed a more reasonable 
approach to solving this than redirecting HOME, please let me know, but it 
looks like that's more or less what the git-daemon patch is doing too.

Evan Priestley

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to