Re: coming from git, understanding mercurial branching
On Fri, Sep 6, 2013 at 2:29 PM, Tim Chase g...@tim.thechases.com wrote: On 2013-09-06 17:51, Konstantin Khomoutov wrote: I found this guide [1] very useful back in the time I tried to grok Mercurial. 1. http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ I've written various blog posts about the subject: http://felipec.wordpress.com/2011/01/16/mercurial-vs-git-its-all-in-the-branches/ http://felipec.wordpress.com/2012/05/26/no-mercurial-branches-are-still-not-better-than-git-ones-response-to-jhws-more-on-mercurial-vs-git-with-graphs/ http://felipec.wordpress.com/2013/08/27/analysis-of-hg-and-git-branches/ Indeed, after reading it, that's the most sense I've been able to make of Mercurial's strange branching. I guess it boils down to the following rough heuristic: - if you want to dink around locally, but don't want to publish your branches (yet), default to bookmarks using hg bookmark Kind of, but then they added support to push bookmarks, so now you can fetch and push them, so not exactly local. In addition, they are starting to think on adding remote namespaces, like in Git, except that jon/devel becomes jon@devel. - once you want a branch to be public, consider making a real branch using hg branch Not necessarily. You can merge or rebase, so the public doesn't see the bookmark. - if you want complete isolation in case you screw up something like merging, use a clone I guess so. There's also the option of using the 'mq' extension, which I guess it's similar to quilt. -- Felipe Contreras -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: coming from git, understanding mercurial branching
On 2013-09-06 12:39, Tay Ray Chuan wrote: First: recognize Mercurial's branches are entirely different beasts from Git's. They just happen to be given a same sequence of characters, b-r-a-n-c-h. The similarities end there! Yeah, I'm trying to create a mental map between what Git means by branching, and what Mercurial means by branching. As you say, they seem to be entirely different beasts. often the docs suggest cloning instead of branching; Are you referring to this? $ hg clone https://... master $ cd master # hack... $ cd .. $ hg clone https://... fix1 Usually I see this written as $ cd .. $ hg clone master fix1 but otherwise, yes. $ cd fix1 # hack... $ cd../master $ hg pull ../fix1 $ hg merge ... In git, you would have your master branch, checkout -b fix1, then merge them back to master when you're done. The above describes how one would do this in mercurial. Mercurial has this cloning-branch thing, a branch command, and something called bookmarks which all seem to have different behaviors (and corresponding reasons to choose them) and yet all be loosely referred to as branching. Cloning litters the drive with duplicate checkouts (even if they use hard-linking for the repo behind the scenes, there's still a lot of time spent writing. The git equiv of this hg suite would be almost identical, cloning a local checkout); the 2nd and 3rd are more branch-related and what I'm trying to grok. -tkc -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: coming from git, understanding mercurial branching
On Thu, 5 Sep 2013 21:27:14 -0500 Tim Chase g...@tim.thechases.com wrote: [...] Do any git users here have good understanding Mercurial branches for the git user resources they've found helpful when working with Mercurial? Preferably a for dummies resource with illustrations comparison charts so I can see the big picture. I found this guide [1] very useful back in the time I tried to grok Mercurial. 1. http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: coming from git, understanding mercurial branching
From: Konstantin Khomoutov flatw...@users.sourceforge.net To: Tim Chase g...@tim.thechases.com On Thu, 5 Sep 2013 21:27:14 -0500 Tim Chase g...@tim.thechases.com wrote: [...] Do any git users here have good understanding Mercurial branches for the git user resources they've found helpful when working with Mercurial? Preferably a for dummies resource with illustrations comparison charts so I can see the big picture. I found this guide [1] very useful back in the time I tried to grok Mercurial. 1. http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ -- Tim, Another recent blog is http://felipec.org/2013/08/27/analysis-of-hg-and-git-branches/ by Felipe Contreras who wrote Git's official GitMercurial bridge; git-remote-hg Philip -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: coming from git, understanding mercurial branching
On 2013-09-06 17:51, Konstantin Khomoutov wrote: I found this guide [1] very useful back in the time I tried to grok Mercurial. 1. http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ Indeed, after reading it, that's the most sense I've been able to make of Mercurial's strange branching. I guess it boils down to the following rough heuristic: - if you want to dink around locally, but don't want to publish your branches (yet), default to bookmarks using hg bookmark - once you want a branch to be public, consider making a real branch using hg branch - if you want complete isolation in case you screw up something like merging, use a clone I still prefer Git's way, but at least I'm not left scratching my head when I have to play with Mercurial branches. Thanks, all. -tkc -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: coming from git, understanding mercurial branching
On Fri, Sep 6, 2013 at 10:27 AM, Tim Chase g...@tim.thechases.com wrote: I've got a pretty good grasp on git's rather straightforward branching, but am trying to wrap my head around Mercurial's branching. There seem to be several flavors, some default to push-public, while others are private; some are tracked in history, while others seem more ephemeral; First: recognize Mercurial's branches are entirely different beasts from Git's. They just happen to be given a same sequence of characters, b-r-a-n-c-h. The similarities end there! often the docs suggest cloning instead of branching; detached heads seem more normal in the Mercurial world. Are you referring to this? $ hg clone https://... master $ cd master # hack... $ cd .. $ hg clone https://... fix1 $ cd fix1 # hack... $ cd../master $ hg pull ../fix1 $ hg merge ... In git, you would have your master branch, checkout -b fix1, then merge them back to master when you're done. The above describes how one would do this in mercurial. -- Cheers, Ray Chuan -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html