git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Sarajärvi Tony" <Tony.Sarajarvi@digia.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: RE: Git --file doesn't override $HOME in version 1.8.1.2
Date: Tue, 9 Jul 2013 12:12:54 +0000	[thread overview]
Message-ID: <C8A88C530F38AE47B22BDC434090CBB0ED276E@IT-EXMB01-HKI.it.local> (raw)
In-Reply-To: <7vmwpwvt7a.fsf@alter.siamese.dyndns.org>



> -----Original Message-----
> From: Junio C Hamano [mailto:gitster@pobox.com]
> Sent: 9. heinäkuuta 2013 15:01
> To: Sarajärvi Tony
> Cc: git@vger.kernel.org
> Subject: Re: Git --file doesn't override $HOME in version 1.8.1.2
> 
> Sarajärvi Tony <Tony.Sarajarvi@digia.com> writes:
> 
> > Using Ubuntu 13.04 with Git 1.8.1.2 I stumbled upon a problem using Puppet.
> >
> > In Puppet we launch Git with the command: '/usr/bin/git config --file
> /home/qt/.gitconfig --get "user.name" "Qt Continuous Integration System"'
> 
> Hmph.  What does this even mean?
> 
>     git config --get user.name "Qt CIS"

Our puppet configuration is available for anyone here:
https://qt.gitorious.org/qtqa/sysadmin/blobs/master/puppet/modules/git/manifests/config.pp

We check with 'unless' if the user.name has been set to what we expect it to be. The return value is different from Git if I typo the name.

root@dev-ubuntu1304-x64-01:~# git config --file /home/qt/.gitconfig --get user.name "Qt Continuous Integration Systed"
root@dev-ubuntu1304-x64-01:~# echo $?
1
root@dev-ubuntu1304-x64-01:~# git config --file /home/qt/.gitconfig --get user.name "Qt Continuous Integration System"
Qt Continuous Integration System
root@dev-ubuntu1304-x64-01:~# echo $?
0

> 
> I have a feeling that the command will exit with an error status 1.
> 
> > However, puppet logs: "fatal: unable to access
> > '/root/.config/git/config': Permission denied".
> >
> > Puppet is run as root, so HOME points to /root, but still -file
> > should override the environment variable.
> 
> Probably.
> 
> > If the same command is run directly from terminal as root, it works as well.
> 
> I am not sure what you mean by "works as well".  It behaves
> differently and does not fail the same way?
> 
Must have been writing something else and changed my mind :) I was trying to say that everything works when run from the command line. The permission denied appears when running with Puppet. And Puppet is run as root. And even if Puppet was run as some other user, I still don't think that Git should be trying to use anything from /root, as we're giving it the --file parameter. As if Puppet removed the whole --file parameter altogether. But as it works with a newer or older version of Git, it can't be dropping the parameter out. Root user is the only one with HOME set to /root, so it must be getting that value from root's HOME variable.

> > With 1.8.3.2 the problem didn't reoccur.
> 
> That is probably due to b1c418e1 (Merge branch
> 'jn/config-ignore-inaccessible' into maint, 2013-06-09)
> 
> But it is puzzling.
> 
> The "error out upon an inaccessible configuration file in usual
> places" check we had since v1.8.1.1 was meant to make sure that you
> will not be missing a basic configuration before running any command
> (including "git config" itself).  As "root", you shouldn't even have
> triggered the "unable to access: Permission denined" in the first
> place.  There is something else going on.

That is also weird, agreed.

      reply	other threads:[~2013-07-09 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 11:05 Git --file doesn't override $HOME in version 1.8.1.2 Sarajärvi Tony
2013-07-09 11:49 ` Thomas Rast
2013-07-09 19:24   ` Jeff King
2013-07-09 12:00 ` Junio C Hamano
2013-07-09 12:12   ` Sarajärvi Tony [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C8A88C530F38AE47B22BDC434090CBB0ED276E@IT-EXMB01-HKI.it.local \
    --to=tony.sarajarvi@digia.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).