git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Sitaram Chamarty <sitaramc@gmail.com>,
	John Arthorne <arthorne.eclipse@gmail.com>,
	git <git@vger.kernel.org>
Subject: Re: receive.denyNonNonFastForwards not denying force update
Date: Mon, 20 Aug 2012 21:57:38 -0400	[thread overview]
Message-ID: <20120821015738.GA20271@sigill.intra.peff.net> (raw)
In-Reply-To: <7v628dght9.fsf@alter.siamese.dyndns.org>

On Mon, Aug 20, 2012 at 06:22:26PM -0700, Junio C Hamano wrote:

> > "git config --system receive.denynonfastforwards true" is not honored.
> >  At all.  (And I checked there was nothing overriding it).
> >
> > "--global" does work (is honored).
> >
> > Tested on 1.7.11
> 
> Thanks, and interesting.
> 
> Does anybody recall if this is something we did on purpose?  After
> eyeballing the callchain starting from cmd_receive_pack() down to
> receive_pack_config(), nothing obvious jumps at me.

No, I do not think it was on purpose. And it would be very hard to do
so, anyway; config callbacks are not given any information about the
source of the config variable, and cannot distinguish between repo,
global, and system-level config variables.

> Could this be caused by a chrooted environment not having
> /etc/gitconfig (now I am just speculating)?

That seems far more likely to me. Another possibility is that the file
is not readable by the user running receive-pack.

> A quick "strace -f -o /tmp/tr git push ../neigh" seems to indicate
> that at least access() is called on "/etc/gitconfig" as I expect,
> which makes me think that near the beginning of git_config_early(),
> we would read from /etc/gitconfig if the file existed (I do not
> install any distro "git", so there is no /etc/gitconfig on my box).

I just did a few quick tests both across local repos and across an ssh
session. receive.denynonfastforwards worked just fine in my
/etc/gitconfig in both cases. So the likely cause would be that git
cannot access that file for some reason (chroot or permissions).

-Peff

  parent reply	other threads:[~2012-08-21  1:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHgXSop42qWcAEGn6=og8Pistv_Jrwhgcnv3B_ORVtSMi1fCHA@mail.gmail.com>
2012-08-20 13:33 ` receive.denyNonNonFastForwards not denying force update John Arthorne
2012-08-20 17:05   ` Junio C Hamano
2012-08-21  0:52     ` Sitaram Chamarty
2012-08-21  1:22       ` Junio C Hamano
2012-08-21  1:53         ` Brandon Casey
2012-08-21  2:16           ` Jay Soffian
2012-08-21  3:46             ` Junio C Hamano
2012-08-21  1:57         ` Jeff King [this message]
2012-08-21  3:49           ` Junio C Hamano
2012-08-21  6:10             ` Jeff King
2012-08-21  6:22               ` Jeff King
2012-08-21  6:26                 ` Jeff King
2012-08-21  6:31                 ` Jeff King
2012-08-21 16:50                 ` Junio C Hamano
2012-08-21 19:33                   ` Jeff King
2012-08-21 16:43               ` Junio C Hamano
2012-08-21 21:52                 ` Junio C Hamano
2012-08-21 21:53                   ` Jeff King
2012-08-21  2:08         ` Sitaram Chamarty
2012-09-10 13:24 ` John Arthorne

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=20120821015738.GA20271@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=arthorne.eclipse@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sitaramc@gmail.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.
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).