Live data from Hacker News

Ask HN: Google/FB engineers, Do you like Mercurial?

news.ycombinator.com

11–20 of 59 posts

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#11
The problem with this question is that there are so many _different ways_ to use Mercurial. hg's core is fairly minimal and everyone I know who uses it rely heavily on core- and third party extensions to get any productive work done.

Mercurial does a good job at facilitating everyone's favourite, yet obscure, workflow. There are people who prefer using things like mq (patchset queues), which until recently also was Mozilla's recommended workflow. Queues are a novel way to organise your work in progress, but is quite different from what people are used to coming from svn or git.

More recently bookmarks were added (also as an extension you have to opt-in to), which are reminiscent of git branches. They make it possible to have a HEAD-based workflow where you rebase frequently, much like you would with git, only that the defaults of `hg log` and various other commands don't interop very well, which means you have to memorise a lot of flags and arguments.

There are also many strange defaults in hg that you simply have to get used to, for example that `hg push` by default pushes everything. I have a hook in place on the remote end which prevents me from doing that.

By far the most frustrating experience with hg is that you cannot expect the default installation to come with sensible defaults. The argument is that keeping "advanced" functionality out of core prevents new users from accidentally using it.

An unintended consequence is that it sometimes makes it difficult for other people to help when you're stuck because more often than not their environment won't match yours.

One frequently lauded aspect of hg is that the user interface is easier to understand. Whilst I appreciate difference in taste, my experience is the opposite. If you follow the HEAD-based bookmark-style workflow, I find many cognitive dissonances in how the bookmark feature interacts with other commands.

At Mozilla we use hg for the canonical repositories and we have many Mozilla related extensions, but whereas I use hg every day now and it's a fine experience as long as I stay within the marked lines, I would return to git in a heartbeat if I had the chance.

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#12
post #7

Earlier quoted context omitted.

I've never used mercurial outside of TortoiseHg. In fact, the only time I've used mercurial is when I was attempting to build Firefox from source before I realized that they do a git mirror thing so you don't have to touch mercurial at all. I don't know much about mercurial. I use git because somebody said it is easier to rewrite history in git.

Why would you rewrite history? Don't be ashamed.

For me, I tend to commit frequently, sort of like my obsession with constantly hitting CTRL-S while working in an IDE. Before I push my changes I like to squash the commits into more cohesive commits. If anything, I think it makes it easier on my colleagues for code review.

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#13
post #3

Why only Google and Facebook engineers? I use both Mercurial and Git, and honestly, they aren't that different. Unless you're doing something very specific I don't see why you would choose one over the other.

I've never used mercurial outside of TortoiseHg. In fact, the only time I've used mercurial is when I was attempting to build Firefox from source before I realized that they do a git mirror thing so you don't have to touch mercurial at all. I don't know much about mercurial. I use git because somebody said it is easier to rewrite history in git.

I don't believe the ability to rewrite history is a good idea. One of the reasons I like Fossil-SCM is that you can't rewrite history.

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#14
post #7

Earlier quoted context omitted.

I've never used mercurial outside of TortoiseHg. In fact, the only time I've used mercurial is when I was attempting to build Firefox from source before I realized that they do a git mirror thing so you don't have to touch mercurial at all. I don't know much about mercurial. I use git because somebody said it is easier to rewrite history in git.

Why would you rewrite history? Don't be ashamed.

Rebase is awesome. Here's an example.

http://michaeldehaan.net/post/116465000577/understanding-whe...

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#15

The problem with this question is that there are so many _different ways_ to use Mercurial. hg's core is fairly minimal and everyone I know who uses it rely heavily on core- and third party extensions to get any productive work done. Mercurial does a good job at facilitating everyone's favourite, yet obscure, workflow. There are people who prefer using things like mq (patchset queues), which until recently also was M…

Do you realise that "HEAD-based" doesn't mean anything? In git you are always at HEAD, by definition. It refers to the commit currently checked out, wherever it may be in history. The only way to not be at HEAD is to have a bare repo without a working directory. Mercurial calls this commit "the parent of the working directory" and uses the notation "." to refer to it.

It's a very widespread common misconception that "HEAD" means "latest", probably because this is what it means in svn.

And this brings up some very interesting usability research from Google: the vast majority of people who use any VCS don't really understand it:

http://static.googleusercontent.com/media/research.google.co...

I realise you are trying to say that you like to rebase and linearise your hg history. This is just `hg pull --rebase`, just like `git pull --rebase`.

> only that the defaults of `hg log` and various other commands don't interop very well, which means you have to memorise a lot of flags and arguments.

I assume you want something like git where "log" by default starts from the currently checked out commit and hides the rest?

You can have that, and if you don't like memorising the incantations to do that, you can save them as aliases in your ~/.hgrc

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#16
post #8

heavy mercurial user. all my open source projects are on it. first at Google code (rip) and now on bitbucket. though i have to use git at work daily. github to add insult... my finger memory is now on git. and that's where git "wins". the chance that you will be forced to use it and learn the awful laundry list of steps to properly use it (hint, if you ever type "pull" you are doing it wrong) you get your finger memo…

> hint, if you ever type "pull" you are doing it wrong

Genuine question: what's wrong with executing 'git pull' on a branch you haven't changed locally?

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#17
post #12
post #7

Earlier quoted context omitted.

Why would you rewrite history? Don't be ashamed.

For me, I tend to commit frequently, sort of like my obsession with constantly hitting CTRL-S while working in an IDE. Before I push my changes I like to squash the commits into more cohesive commits. If anything, I think it makes it easier on my colleagues for code review.

I do the same in hg. I do `hg amend` all the time to keep adding changes to my commit. At the end I may selectively undo some changes with `hg uncommit --interactive` or `hg uncommit --all` and redo the whole thing piecemeal with `hg commit --interactive` in order to slowly split up my work into several commits. Evolve makes it really easy to keep (and ignore!) a meta-history of all of my editions, with a clear lineage of which new commit replaced which prior commit.

I may also rebase my work onto the latest head at the end (not to be confused with git HEAD).

And all of this with a very nice interface. It's always --interactive, not sometimes --patch and sometimes --interactive.

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#18
post #8

heavy mercurial user. all my open source projects are on it. first at Google code (rip) and now on bitbucket. though i have to use git at work daily. github to add insult... my finger memory is now on git. and that's where git "wins". the chance that you will be forced to use it and learn the awful laundry list of steps to properly use it (hint, if you ever type "pull" you are doing it wrong) you get your finger memo…

> hint, if you ever type "pull" you are doing it wrong Genuine question: what's wrong with executing 'git pull' on a branch you haven't changed locally?

It could be rebased upstream. While it's a really bad practice, it could happen.

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#19
post #8

heavy mercurial user. all my open source projects are on it. first at Google code (rip) and now on bitbucket. though i have to use git at work daily. github to add insult... my finger memory is now on git. and that's where git "wins". the chance that you will be forced to use it and learn the awful laundry list of steps to properly use it (hint, if you ever type "pull" you are doing it wrong) you get your finger memo…

> hint, if you ever type "pull" you are doing it wrong Genuine question: what's wrong with executing 'git pull' on a branch you haven't changed locally?

Nothing unless you're rebasing upstream, but I think the point he was trying to make was that you should always run `git fetch` and then `merge` from there (again, there are some situations where the pull is fine IMHO).

Re: Ask HN: Google/FB engineers, Do you like Mercurial?

#20
post #7

Earlier quoted context omitted.

Why would you rewrite history? Don't be ashamed.

Rebase is awesome. Here's an example. http://michaeldehaan.net/post/116465000577/understanding-whe...

No it's not, it rewrites and destroys history. The problem it solves is "keeping the history clean", when actually it's not what you want. You don't see your history, you see logs and diffs. So you want to keep your logs and diffs clean. There should be an other solution to this other than simply removing/merging commits and eventually removing information with it.
Post reply on HN