Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a downside to this Mercurial workflow: named branch "dead" head?

I love the flexibility of named branches but I have some concerns about the prolifieration of heads.

Even when the branch is closed, it still shows up in the heads. I have an idea for how to clean up the output from "hg heads" My question to the gurus: "What am I missing?"

First off you may ask, Why might I want to totally hide the head of a named branch? For various reasons:

  • the feature is a bad idea
  • the feature is a good idea that is not ready for merging to tip, but maybe in a few months
  • the branch is a patch release to an older tagged version

edit: It turns out the prolifiration of heads is a symptom of the older version of mercurial I was using. Closing the branch hides the head of the branch it on newer Mercurial versions.

My idea is to have a "dead" head branch onto which all these closed branch heads will be merged.
The dead head would be parented by changeset 0 and serve the sole purpose of bundling up the stray heads that are not needed right now.

The deadhead has only other deadhead children, which never get merged back into the default branch.

like image 504
Mark Borgerding Avatar asked Sep 03 '10 19:09

Mark Borgerding


1 Answers

You can use hg commit --close-branch to mark a branch as closed:

http://www.selenic.com/mercurial/hg.1.html#commit

Closed branches will not show up in hg branches or hg heads by default (only if the -c/--closed option is specified), so I'm not sure how you're seeing "clutter"?

What exactly would you gain by merging things?

like image 95
Amber Avatar answered Nov 08 '22 14:11

Amber