From: Jay Soffian <jaysoffian@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jeff King <peff@peff.net>,
Sergio Callegari <sergio.callegari@gmail.com>,
git@vger.kernel.org
Subject: Re: PUSH_HEAD, was Re: disallowing push to currently checked-out branch
Date: Tue, 17 Feb 2009 12:29:53 -0500 [thread overview]
Message-ID: <76718490902170929v3ed9e3c2tb2f7fb1bfc01b3ab@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0902171200250.6185@intel-tinevez-2-302>
On Tue, Feb 17, 2009 at 6:28 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>> receive.localBranches = (refuse | allow)
>>
>> http://thread.gmane.org/gmane.comp.version-control.git/77955/focus=78065
>
> In the meantime, we have receive.denyCurrentBranch, which is much superior
> to the localBranches design: it tackles the _real_ issue -- the only
> reason why a current branch cannot be updated lightly is that it might
> have a working directory which would be forced out-of-sync.
Hmpfh.
So both you and Junio have changed your mind since that thread then.
Because in that thread, you propose receive.guardCurrentBranch, which
was quite similar to today's receive.denyCurrentBranch. Junio then
argues that treating just the checked-out branch as special, as
opposed to all local branches is not the right thing to do:
--- snip ---
http://thread.gmane.org/gmane.comp.version-control.git/77955/focus=78062
Step back a bit and think _why_ you wanted to prevent current branch tip
from getting updated in the first place. There are two issues:
* Why is it _current_ branch, and not _these branches_, that can be
configured by the user to be protected from a push from sideways?
* Why is it undesirable for the work tree and the index to go out of sync
with respect to the branch tip to begin with?
The latter is simpler to answer, so let's deal with it first. The reason
why it is bad is because allowing a push to the current branch interferes
with the work actively being done in the repository, using the work tree
contents. There is a person, you, who is actively editing the work tree
in order to advance the tip of the branch by making commits. If the
branch tip moves without your knowing, that destabilizes your working
environment. Your work tree wanted to make a new commit on top of some
known state, but that state was moved underneath you. Not good.
When you are using the repository for real work (i.e. advance the tips of
its branches), you want a stable environment. You do not want its HEAD
bobbing around outside your control, and silently detaching to cause your
later commits to go to unnamed branch without your knowing is just as bad
(which you already correctly objected to).
--- snip ---
And you end up agreeing:
--- snip ---
http://thread.gmane.org/gmane.comp.version-control.git/77955/focus=78062
> Now think. What if one of these operations you do in the repository to
> advance the tip was to merge from one of _your_ local branches? Yes,
> you end up merging something you did not expect to merge if you allowed
> a push from sideways to affect that local branch, only because the
> branch happened to be un-checked-out and you implemented this protection
> to forbid only to current branch. Allowing a push from sideways to any
> local branch destabilizes your work environment, not just the current
> one.
Okay, I am starting to see the light.
How about
receive.localBranches = (refuse | allow)
--- snip ---
Then the thread died, with receive.localBranches going into TODO, but
never got an implementation. Sometime later, receive.denyCurrentBranch
came along, which is the original idea you proposed, Junio argued
against, and then you agreed.
So, I'm not sure what happened in the intervening time between the
receive.localBranches proposal and the receive.denyCurrentBranch
implementation that suddenly what is basically guardCurrentBranch
became a good idea.
But, I happen to agree with Junio's argument in gmane 77955.
j.
next prev parent reply other threads:[~2009-02-17 17:31 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 21:31 [RFC - draft] List of proposed future changes that are backward incompatible Junio C Hamano
2009-02-15 21:48 ` Junio C Hamano
2009-02-15 22:56 ` Jakub Narebski
2009-02-15 23:39 ` Junio C Hamano
2009-02-15 23:20 ` Heikki Orsila
2009-02-16 0:04 ` disallowing push to currently checked-out branch Jeff King
2009-02-16 1:33 ` david
2009-02-16 1:47 ` david
2009-02-16 1:30 ` Julian Phillips
2009-02-16 4:01 ` Jeff King
2009-02-16 8:33 ` Daniel Barkalow
2009-02-16 8:51 ` Junio C Hamano
2009-02-16 10:17 ` Sergio Callegari
2009-02-16 13:58 ` Jeff King
2009-02-16 17:13 ` Sergio Callegari
2009-02-16 17:33 ` Matthieu Moy
2009-02-16 17:43 ` Johannes Schindelin
2009-02-16 18:48 ` Jay Soffian
2009-02-16 20:02 ` Johannes Schindelin
2009-02-16 21:12 ` Jay Soffian
2009-02-16 21:15 ` Johannes Schindelin
2009-02-16 22:28 ` Jay Soffian
2009-02-16 22:52 ` Jeff King
2009-02-17 5:53 ` Jay Soffian
2009-02-17 11:28 ` PUSH_HEAD, was " Johannes Schindelin
2009-02-17 17:29 ` Jay Soffian [this message]
2009-02-17 19:48 ` Jeff King
2009-02-17 22:20 ` Junio C Hamano
2009-02-17 22:42 ` Jay Soffian
2009-02-17 22:54 ` Johannes Schindelin
2009-02-16 19:24 ` Sergio Callegari
2009-02-16 20:09 ` Johannes Schindelin
2009-02-16 21:42 ` Jay Soffian
2009-02-17 0:07 ` Sergio Callegari
2009-02-17 0:18 ` Johannes Schindelin
2009-02-17 0:41 ` Sergio Callegari
2009-02-17 0:56 ` Johannes Schindelin
2009-02-17 1:18 ` Junio C Hamano
2009-02-17 0:57 ` Junio C Hamano
2009-02-16 21:43 ` Junio C Hamano
2009-02-16 22:43 ` Jeff King
2009-02-16 23:23 ` Junio C Hamano
2009-02-17 0:23 ` Jeff King
2009-02-17 0:43 ` Junio C Hamano
2009-02-17 1:29 ` Jeff King
2009-02-16 3:50 ` Jeff King
2009-02-16 5:05 ` david
2009-02-16 4:05 ` Jeff King
2009-02-16 5:18 ` david
2009-02-16 4:37 ` Jeff King
2009-02-16 5:55 ` david
2009-02-16 5:06 ` Jeff King
2009-02-16 10:53 ` Johannes Schindelin
2009-02-16 10:50 ` dashed commands, was " Johannes Schindelin
2009-02-15 23:53 ` [RFC - draft] List of proposed future changes that are backward incompatible david
2009-02-15 23:01 ` Johannes Schindelin
2009-02-15 23:36 ` Junio C Hamano
2009-02-16 0:14 ` david
2009-02-15 23:18 ` Johannes Schindelin
2009-02-16 0:38 ` david
2009-02-16 0:29 ` Junio C Hamano
2009-02-16 10:23 ` Johannes Schindelin
2009-02-16 15:33 ` david
2009-02-16 14:40 ` Sverre Rabbelier
2009-02-16 0:02 ` disallowing push to currently checked-out branch Jeff King
2009-02-16 10:06 ` Sergio Callegari
2009-02-15 23:01 ` [RFC - draft] List of proposed future changes that are backward incompatible Jakub Narebski
2009-02-15 23:15 ` Johannes Schindelin
2009-02-15 23:38 ` Jakub Narebski
2009-02-16 0:35 ` david
2009-02-16 0:07 ` send-email sending shallow threads by default Jeff King
2009-02-16 0:09 ` Pieter de Bie
2009-02-16 2:43 ` Jeff King
2009-02-16 2:55 ` Brian Gernhardt
2009-02-16 9:56 ` Wincent Colaiuta
2009-02-16 7:55 ` SZEDER Gábor
2009-02-16 10:38 ` Martin Mares
2009-02-17 8:34 ` Andreas Ericsson
2009-02-17 9:06 ` Martin Mares
2009-02-17 19:28 ` Jeff King
2009-02-20 3:03 ` Eric W. Biederman
2009-02-20 3:26 ` Jeff King
2009-02-20 4:13 ` Eric W. Biederman
2009-02-17 8:30 ` Andreas Ericsson
2009-02-16 1:27 ` [RFC - draft] List of proposed future changes that are backward incompatible Sitaram Chamarty
2009-02-16 8:04 ` Björn Steinbrink
2009-02-16 8:49 ` Junio C Hamano
2009-02-16 9:07 ` Björn Steinbrink
2009-02-16 2:42 ` [RFC - draft #2] " Junio C Hamano
2009-02-16 3:20 ` Jeff King
2009-02-16 21:10 ` Jakub Narebski
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=76718490902170929v3ed9e3c2tb2f7fb1bfc01b3ab@mail.gmail.com \
--to=jaysoffian@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=sergio.callegari@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).