Subject: Re: git pull for update of netdev fails.

From: Shawn Pearce <[email-masked]>
Date: Wed, 20 Sep 2006 17:53:18 -0400

Junio C Hamano <[email-masked]> wrote:
> Johannes Schindelin <[email-masked]> writes:
> 
> > I'd rather set another config variable with --shared, which tells git to 
> > refuse receiving non-fast-forwards. This could be a sensible setting in 
> > other setups than shared ones after all. Thoughts?
> 
> If this option is meant to forbid fixing up an screw-up by doing
> "git-push --force", I do not quite like it.

Yes, it is meant for stopping exactly that.

As the repository owner with direct access to the repository I
don't want anyone to be able to use --force to reset a branch.
If a branch reset needs to happen I want to do it directly on
the repository.  Its a rather destructive operation, as we have
been saying.  I don't want a user slamming in "--force" just because.

On the other hand you can also configure the option to allow
`git push --force` and craft a smart update hook which looks at
who is doing the push and if that is permissible to the ref in
question; exit'ing non-zero if not.

Basically I don't see why an update hook should be necessary to
disallow all non-fast forward pushes.

> It sounds as if arguing that "rm -fr" is dangerous so presence
> of -f and -r at the same time should imply -i option.  I think
> the right answer is not making -i implied, but train the user to
> understand what -fr means before using it.

Some people cannot be trained.  No matter how hard you may try.

-- 
Shawn.