News for hackers. Stuff that matters.
Re:Mercurial 2.9 released by notwedtm on Sunday February 02, 2014 @07:55PM (#7168289)
I would be interested in hearing from people who are using hg still. What is the reasoning? Do you see something in hg that the rest of us don't? Are there specific features of hg that git doesn't have?
Re:Mercurial 2.9 released by nilved on Sunday February 02, 2014 @08:28PM (#7168371)
Mercurial isn't the terrible DVCS that people left for greener git pastures; indeed it's the opposite: GitHub is why git won, and people are still learning how terrible git is and how awesome Mercurial is. They don't "still use" Mercurial, they "still use" git.

Mercurial has a great API. git has a terrible API. Mercurial is a joy to extend in Python. git is impossible to extend to any meaningful degree and is a terrible mess of Perl, shell script and C.

git is a hack and Mercurial is the future.

Re:Mercurial 2.9 released by kyrra on Sunday February 02, 2014 @08:54PM (#7168428)
Git an Mercurial are so similar. You have to remember that Git, Mercurial, and Bazaar were all released within a month of one another to do basically the same thing (because BitKeeper took their licenses away from linux debs). They all have very similar concepts and try to solve the same problem in near the same way. Each of these DVCSs have stolen concepts from one another and there isn't a lot differentiating them. Sure, syntax and terminology differ, but they all end up working pretty similar to one another.

You have tools like Kiln Harmony[0] that lets you use git/mercurial for the same repo (looks like it cross-commit between the 2).

Git gives you all commands all at once, while Mercurial gives you just the functionality needed 90% of the time that can't really get you in trouble. Mercurial ships officially supported extensions with Mercurial that let you do history rewriting and other fun stuff that people are used to with git rebase.

I'm more a fan of Mercurial's CLI syntax/terminology, but Git has really won the popularity contest at this point. If you ever have questions about Git usage, the question has probably already been asked and has a lot more people that know and enjoy it.

Mercurial does have some advantages going for it still I believe. Being purely written in python makes it work a bit better on Windows. And as Facebook has said, it is easier to develop new plugins for Mercurial (at least given their skillset). I also like the Mercurial Largefile extension (if you have to deal with a lot of binary data). I know there are 3rd party modules like git-annex, but nothing officially part of Git.

[0] http://blog.fogcreek.com/kiln-harmony-internals-the-basics/

Re:Mercurial 2.9 released by yapcguy on Sunday February 02, 2014 @08:49PM (#7168416)
I use both. I dont think Git 'won' but it is more popular. I suspect many git users dont even know why they use git except because they were told to, they probably never tried hg or know anything about darcs, bitkeeper, etc.
Re:Mercurial 2.9 released by sopooneo on Sunday February 02, 2014 @10:57PM (#7168738)
I use Git because everyone else does. And I'm not ashamed of that; I think it's pragmatic. However, I think I would prefer if the crowd had converged on Mercurial instead.
Re:Mercurial 2.9 released by kyrra on Sunday February 02, 2014 @11:38PM (#7168878)
But being more popular is a reason groups will pick it. See Emacs's discussion on moving away from BZR [0]. While there are some people that like HG, Git popularity brings some benefits with it.

A larger user base and a large number of companies using it mean that there will be more investment in the tool. So there is a variety of companies that invest in it. There is a smaller chance development will stop on Git compared to HG. So basically the Emacs team concluded they don't want to be stuck with another BZR, and Git seems like a safer choice.

A variety of companies have bet on HG, but decided they needed to support Git along side it to get more sales (Fog Creek and Atlassian).

I feel like Github was the deciding tech that made Git the more popular code. There are a number of other companies supporting HG still, so it won't go away anytime soon, but it's hard to say if it'll be here as long as Git.

[0] http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg000...

Re:Mercurial 2.9 released by leobelle on Sunday February 02, 2014 @09:27PM (#7168493)
I like git because it stores objects, not diffs and you can recover from almost anything with reflog.
Re:Mercurial 2.9 released by anton_gogolev on Sunday February 02, 2014 @10:11PM (#7168586)
> I like git because it stores objects, not diffs

Now _that's_ a reason to pick a VCS! Would you drop Git if you found out that this is not true [1]?

[1]: http://git-scm.com/book/en/Git-Internals-Packfiles

Re:Mercurial 2.9 released by tomlu on Sunday February 02, 2014 @11:18PM (#7168801)
I see where he is coming from even if the wording is ambiguous. Git presents the abstraction of storing objects, and diffs are inferred. The exact implementation is beside the point.
Re:Mercurial 2.9 released by tonfa on Monday February 03, 2014 @02:43AM (#7169361)
But then mercurial is the same, the abstraction is about file content, the diff compression is an internal detail of the storage format like packs.
Re:Mercurial 2.9 released by tomlu on Thursday February 06, 2014 @02:10AM (#7189128)
Yeah for sure. Mercurial is great too.

I was thinking of SVN which does store its commits as diffs, which makes it brittle (anyone that has tried to use the svn admin tools to rewrite the repository will know what I mean).

Re:Mercurial 2.9 released by the_mitsuhiko on Sunday February 02, 2014 @09:09PM (#7168463)
> Mercurial isn't the terrible DVCS that people left for greener git pastures; indeed it's the opposite:

For everybody who does not like git there is one who does. I vastly prefer git over hg after having used hg for a few years and I did not regret switching a single bit.

Re:Mercurial 2.9 released by isxek on Sunday February 02, 2014 @08:14PM (#7168339)
Speaking for myself: the one specific thing I use every now and then in Mercurial is "hg serve" command. It allows me to serve up my changes to others in an ad-hoc way without needing to set up a repo in the usual places (Bitbucket, Github, etc.).

If one needs to set up a local repo hosting service for internal use in a .NET company, there's SCM Manager (http://www.scm-manager.org/), which is free, supports both Hg and Git, and (IMO) pretty easy to put up on a Windows server. I have not tried others that use purely Git, though, and I've never tried setting SCM Manager up on a Linux server.

Personally, I have no problem if the whole team decides to use Git instead of what we're using now (TFS), but most of them, if not all, avoid the CLI like a plague. Even with excellent GUI frontends like Git Extensions and SourceTree.

Re:Mercurial 2.9 released by the_mitsuhiko on Sunday February 02, 2014 @09:10PM (#7168464)
> Speaking for myself: the one specific thing I use every now and then in Mercurial is "hg serve" command. It allows me to serve up my changes to others in an ad-hoc way without needing to set up a repo in the usual places (Bitbucket, Github, etc.).

You can do the same in git:

git daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/

or

git daemon --verbose --export-all --base-path=. --reuseaddr .

Re:Mercurial 2.9 released by isxek on Sunday February 02, 2014 @11:01PM (#7168746)
AFAIK, this does not work with Git in Windows. I will try it at home where I have Lubuntu and see. (If it works, I'll make an alias for it.) Thanks.
Re:Mercurial 2.9 released by mahmoudhossam on Monday February 03, 2014 @02:02AM (#7169246)
Or you can use git instaweb instead?
Re:Mercurial 2.9 released by lttlrck on Monday February 03, 2014 @07:56AM (#7170359)
Or SSH
Re:Mercurial 2.9 released by anton_gogolev on Sunday February 02, 2014 @10:12PM (#7168593)
> If one needs to set up a local repo hosting service for internal use in a .NET company,

There's also (shameless plug follows) HgLab ( http://hglabhq.com/ ).

Re:Mercurial 2.9 released by isxek on Sunday February 02, 2014 @11:04PM (#7168756)
I was supposed to try this out after SCM Manager, but our IT admin has not replaced the server I was using after it broke. If I ever get access to one again, I'll try it.
Re:Mercurial 2.9 released by yapcguy on Sunday February 02, 2014 @08:50PM (#7168418)
SourceTree seems to get slower and slowerespecially if you have submodules and lots of branches. Not sure why. Any good alternatives out there?
Re:Mercurial 2.9 released by isxek on Sunday February 02, 2014 @08:55PM (#7168429)
If you're using just Git, have you tried Git Extensions (https://code.google.com/p/gitextensions/)? We don't use any submodules where I work, so I've never tried it with that.
Re:Mercurial 2.9 released by reactor on Sunday February 02, 2014 @08:34PM (#7168384)
I've been using both Git and Hg for different projects and found with recent releases (2.6 onwards) mercurial getting quite fast. I think hg commands are more sane and exposes only what it's required by users. Also there isn't anything you can do with hg but can't do with git and vice versa, if you look closely. These are just the tools that must help you get going, so if you/co-workers are comfortable with git, there is no reason to switch to hg. (and from hg to git as well). They both have pros and cons so we will never find THE BEST dvcs. Don't bother too much (they both are super capable) rather focus on problems that need more attention.
Re:Mercurial 2.9 released by erichurkman on Sunday February 02, 2014 @08:23PM (#7168357)
Mozilla does. It's been discussed numerous times on mozilla.dev mailing lists [1], with a lot of great discussion about it.

[1] https://groups.google.com/forum/#!topic/mozilla.dev.platform...

Re:Mercurial 2.9 released by clarkevans on Sunday February 02, 2014 @08:33PM (#7168382)
Re:Mercurial 2.9 released by grey413 on Sunday February 02, 2014 @11:35PM (#7168867)
Four reasons, all dating back to when I started using VC.

1) The GUIs were better, especially on windows. I think that gap has closed some in the last few years, but I think hg still has an edge.

2) Bitbucket offered free private repos and was hg only when they started out

3) The command line semantics were less imposing

4) I happened to find some really good introductory literature for hg.

I was a very, very green developer at the time so all of these points mattered a lot.

Re:Mercurial 2.9 released by toggle on Sunday February 02, 2014 @08:49PM (#7168417)
For me, it's:

1. The queues extension.

2. A bazillion other extensions.

3. The source code is pretty reasonable -- even mortal humans can contribute and write their own extensions.

I've found the queues extension to be really useful. It's like having multiple staging areas, which will later become multiple commits. I tend to change too many things, and then remember that I need to create specific commits. Queues makes that possible. I haven't found a good way of doing that in git, although I still use git every day without any big problems.

Re:Mercurial 2.9 released by Skinney on Sunday February 02, 2014 @11:51PM (#7168918)
git stash?

Actually, you can also just create a branch, commit your work (instead of hg qpush) and just use git rebase --interactive when you want to "finalize" your work.

Re:Mercurial 2.9 released by jordigh on Monday February 03, 2014 @12:27PM (#7172038)
The exact same workflow works pretty much the same way in hg, with shelve (stash) and histedit (rebase -i). There is even a better way nowadays with hg evolve, but it's still beta.
Re:Mercurial 2.9 released by Skinney on Monday February 03, 2014 @03:54PM (#7173408)
Hows the backup story with Hg nowadays? Git uses an immutable storage solution, so rebasing or other commands to alter history doesn't delete anything. Hg doesn't have the same architecture, so how does undoing histedit work? Genuinly interested, not trying to start a flamewar.
Re:Mercurial 2.9 released by meritt on Sunday February 02, 2014 @08:22PM (#7168355)
We use hg because bitbucket.org offered free private repos (no git back then) and it completely meets our needs.

I'm also not familiar enough with git to know what benefits it provides over mercurial.

Re:Mercurial 2.9 released by mamcx on Sunday February 02, 2014 @09:28PM (#7168498)
I consider hg far more easy to use than git, specially for the most used commands (status, fetch, push). I need to check the docs about how do the damm push each time with github.

My only gripe with mercurial? That everyone else asume git.

Re:Mercurial 2.9 released by Skinney on Sunday February 02, 2014 @11:52PM (#7168921)
check the docs? What is so hard to remember about "git push"?
Re:Mercurial 2.9 released by jordigh on Monday February 03, 2014 @12:28PM (#7172051)
This:

    jordi@Iris:~$ git help push | wc -l
    544
    jordi@Iris:~$ hg help push | wc -l
    50
Re:Mercurial 2.9 released by Skinney on Monday February 03, 2014 @03:56PM (#7173428)
This is due to Git's tight integration with regards to branches and namespaced branches though isn't it? Hg push isn't aware of bookmarks as far as I know, so Git has more to explain compared to Hg, where lightweight branches are a plugin. Or am I wrong on this?
Re:Mercurial 2.9 released by jordigh on Monday February 03, 2014 @09:34PM (#7175131)
Wow. I use Mercurial so much, that I forget that some people have no idea about it at all.

No, hg bookmarks are not a plugin, although they were like four years ago. Hg push has this to say about bookmarks:

     If -B/--bookmark is used, the specified bookmarked revision, its ancestors, and the bookmark will be pushed to the remote repository.
That's all it has to say. If you do "hg help bookmarks", you'll get more options about bookmarks, but they're not immediately relevant to pushing.
Re:Mercurial 2.9 released by Skinney on Tuesday February 04, 2014 @01:41AM (#7175874)
It is still a plugin, it's just bundled/installed by default. I've worked with Mercurial for the better part of a year, I'm not clueless about it.

But yeah, since branches/bookmarks are an integral part of how you work with Git, you also have more options regarding branches/bookmarks in several git commands. Git allows you to push a local branch to a remote branch of a different name. This is helpfull when you're pushing to different remotes, and the some of the local branches should map to master on different remotes. But this of course requires more information to stand in git pull's documentation. There are, of course, other features as well.

Just because git push has some 'advanced' featues, doesn't make the actual push command difficult to understand though. Most of the time you just use 'git push', same as Mercurial, git just allows you to do more with git push than what Mercurial allows you to.

Re:Mercurial 2.9 released by benrhughes on Monday February 03, 2014 @01:31AM (#7169172)
At work we have non-devs (mostly scientists) using our repos, and I didn't want to have to teach them git. Mercurial is much easier to pick up IME. With the right plugins enabled, there's not much I miss day to day compared with git.

At home I still use git. In part because of github, in part because I like some of the default behaviour better, and in part because being forced to learn how it works to dig my way out of holes broadens my understanding of DVCSs in general.

Re:Mercurial 2.9 released by imakesnowflakes on Monday February 03, 2014 @02:34AM (#7169331)
Mercurial gives you complete DAG of history with enough tools (revsets) to filter and view it in any way.

Git lets you peep into the DAG of history through small windows, called 'branches'.

This was the biggest annoyance for me when I tried git. You cannot even ask git for the id of the currently checked out revision, ie if you are not on a branch tip.

And yes, the inconsistent cli is a big turnoff too.

Re:Mercurial 2.9 released by dscrd on Sunday February 02, 2014 @11:42PM (#7168896)
I got used to how hg works and now, in comparison, git always confuses the hell out of me with its unintuitive commands and odd walls-of-text errors.