Skip to content

Comment on Why Git Ain’t Better Than Xparent

Comments

Git's branches aren't _branches_ per se. They're movable references to heads, and there's no indication of a commit having been done on a branch once it's merged and the ref deleted.

If you want that workflow in Mercurial, use bookmarks. Some work is left to make bookmarks pushable, but it's going to be done, as many people want that feature.

Don't delude yourself that there's anything correct about storing the name of a branch in a commit, or that that's what makes up a proper branch.

When I receive a changeset in mercurial and see that it was made on a branch called "dev", that means nothing to me. When I get changes from several locations and they all say it was made on "dev", that helps me even less.

If it's actually important to you to know that a change was done on a branch called "dev" (and I doubt it ever will be), it's fairly easy to know just by examining the merge commit that brought it in.

In practice, I'd say it's just confusing. I wrote "hg log -b" initially for viewing logs only within a branch. As it turns out, you have to be really careful to name your branches since they can be reused (or worse as shown above) and it's very difficult to figure out whether a change occurred on a given branch or a different branch that had the same name.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.