Closed branch push behavior?

Chuck.Kirschman at bentley.com Chuck.Kirschman at bentley.com
Tue Dec 6 07:19:13 CST 2011


I like the way you think Matt.  Unfortunately it just doesn't scale.  Think hundreds of developers in dozens of countries and a hundred repository yet only one of me.  If I can't enforce the policy on the server, then I can't enforce it.  I'll put in a commit hook and I will take your suggestion and put in that extra warning as well.  

Thanks
chuck

-----Original Message-----
From: Matt Mackall [mailto:mpm at selenic.com] 
Sent: Monday, December 05, 2011 5:57 PM
To: Chuck Kirschman
Cc: mercurial at selenic.com
Subject: RE: Closed branch push behavior?

On Mon, 2011-12-05 at 16:52 -0500, Chuck.Kirschman at bentley.com wrote:
> Unfortunately for me, the user read the helpful message, pushed the 
> branch to the server, which as you state makes it permanent.  It's 
> been pulled by many, and trying to get the genie back into the bottle 
> is nigh on impossible.  Is there any way to prevent it in the future?

Here's the thing: the same problem potentially exists with tagging, but people basically never have to say "how do we implement a system to keep our idiotic users from tagging random releases?" because it's just obvious that you shouldn't do that. And indeed, people using SVN or CVS don't have this problem with branch naming either, even though they have named branching that's conceptually identical to Mercurial. 

The problem is Git. Git "branches" are a completely different animal from CVS/SVN/Mercurial branches in that they're completely ephemeral.
Mercurial actually has a close analog to Git branches called bookmarks, but that won't help users who try to blindly apply Git practices without reading 'hg help branch':

    Note:
       Branch names are permanent. Use "hg bookmark" to create a light-weight
       bookmark instead. See "hg help glossary" for more information about
       named branches and bookmarks.

I recommend communicating a policy for both branching and tagging and that policy should be something like: "only Chuck Kirschman gets to add tags or branches, but you may use bookmarks". You should no more tolerate people sticking random branch names in the tree than you would tolerate people tagging random release numbers, adding random files, etc.

I might also consider something adding something like:

 $ hg branch foo
 marked working directory as branch foo
 warning: branches are permanent and global, did you want a bookmark?

--
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list