"named branches" vs "bookmarks" FUD

Bob Hood bhood2 at comcast.net
Fri Jan 3 23:46:01 UTC 2014


On 1/3/2014 9:04 AM, Matt Mackall wrote:
> On Fri, 2014-01-03 at 18:33 +0300, anatoly techtonik wrote:
>> I feel fear when touching named branches in Mercurial.
>> I tried to track it down:
>>
>>
>>  "Many people don’t like cluttering up changeset metadata with branch
>> names, especially if they’re small branches that are going to be
>> merged pretty quickly."
>> http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/#branching-with-named-branches
>>
>> fear 1. cluttering changeset metadata
>>
>>
>> $ hg branch versions
>> marked working directory as branch versions
>> (branches are permanent and global, did you want a bookmark?)
>>
>>
>> fear 2. warning
>> uncertainty 1. permanent and global are bad
>>
>> "it is almost never a good idea to use this facility for short-term
>> branching, since branches created this way are inherently “eternal”"
>> http://mercurial.selenic.com/wiki/BranchingExplained
>> pointed by
>> http://bryan-murdock.blogspot.com/2012/01/what-is-so-wrong-with-mercurials-named.html
>>
>> fear 3. named branches are inherently "eternal"
>> fear 4. inherently "eternal" is evil
>> uncertainty 2. named branches are bad for short-term branching
>>
>>
>> So, looking at all these sources of *semi-official* FUD, I wonder -
>> are there some inherent problems with Mercurial internals that affect
>> performance or other aspects that make Mercurial developers impose
>> specific workflow (avoid short-term named branched) on its users?
>>
>> Otherwise I don't see why people should be discouraged of using them.
>> Tagging series of changesets with meaningful names makes project history
>> better, not worse.
> Here's the short version:
>
> - we introduced a named branch feature very similar to the feature
> present historically in every other SCM except Git
> - many people tried to use it like the completely different history-less
> feature with the same name in Git based on blindly copying Git howtos
> - these people who had clearly never read the named branch docs or ever
> used any SCM other than Git complained when they couldn't get rid of the
> branches they created
> - such people showed up to complain on a daily basis for a couple years
> - we eventually got sick of their whining
> - we put in warnings
> - they've mostly shut up (woo!)
>
> We have users with thousands of named branches in production and have
> done tests on up to 10k branches and the performance impact is fairly
> minimal.
>
> The warnings are there for gitwits, if you have reading comprehension
> skills, please proceed.

We migrated from Subversion, and we use named branches in Mercurial (as we did
in Subversion) to manage multiple product versions and multiple release points
for our software.  Named branches seemed a better mechanism for us than
bookmarks for being able to recreate past GA releases (for evaluating bug
reports or validating features, for example).

So far for us, there's been zero defects detected using named branches in
Mercurial.



More information about the Mercurial mailing list