From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jordi =?ISO-8859-1?Q?Guti=E9rrez?= Hermoso Newsgroups: gmane.emacs.devel Subject: Re: Prefer Mercurial instead of git Date: Sun, 05 Jan 2014 08:19:27 -0500 Message-ID: <1388927967.11337.32.camel@Iris> References: <1388785952.11337.16.camel@Iris> <874n5k12ft.fsf@fencepost.gnu.org> <1388841220.11337.21.camel@Iris> <87bnzrzuzp.fsf@fencepost.gnu.org> <1388846441.11337.25.camel@Iris> <8738l2k4hh.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1388927981 7467 80.91.229.3 (5 Jan 2014 13:19:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jan 2014 13:19:41 +0000 (UTC) Cc: David Kastrup , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 14:19:45 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VzncD-0000qZ-AV for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 14:19:41 +0100 Original-Received: from localhost ([::1]:57902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzncC-0003ms-ST for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 08:19:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vznc6-0003mm-EJ for emacs-devel@gnu.org; Sun, 05 Jan 2014 08:19:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vznc1-0007Bh-S6 for emacs-devel@gnu.org; Sun, 05 Jan 2014 08:19:34 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vznc1-0007Bd-O2 for emacs-devel@gnu.org; Sun, 05 Jan 2014 08:19:29 -0500 Original-Received: from beast.bic.mni.mcgill.ca ([132.206.178.199]:37920 helo=[IPv6:::1]) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Vznc0-00041c-Nx; Sun, 05 Jan 2014 08:19:28 -0500 In-Reply-To: <8738l2k4hh.fsf@uwakimon.sk.tsukuba.ac.jp> X-Mailer: Evolution 3.4.4-3 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:167361 Archived-At: On Sun, 2014-01-05 at 21:17 +0900, Stephen J. Turnbull wrote: > Jordi Guti=C3=A9rrez Hermoso writes: > > And I think Mercurial is a good choice, and I will choose it again, > > and again. >=20 > The problem is that Mercurial isn't git. Git definitely is the > leader now. Git is "cool". Git is more flexible (neither Mercurial > nor Bazaar can support workflows that use colocated branches > heavily). Huh, bookmarks? We use "collocated branches" heavily in GNU Octave during our GSoC experience, and it worked just fine. Our GSoC students were each working on their bookmark, and we've pulled their code into mainline when it was ready. Otherwise we typically use named branches, since it's easier for core devs to just watch at most 2 or 3 branches at the same time over a long period of time. Both branching types have their uses. > Git has more growth potential: new techniques for manipulating DAGs > are developed in and for git. (They can't be developed *in* > Mercurial or Bazaar command language, you have to go to Python level > to develop useful new features.) This isn't true, Mercurial's API is its CLI (so is git's, really, but git is bold enough to also call it a UI, which I don't think it deserves). Its CLI is what is promised to remain stable, and you can develop plenty of tools with its CLI only, and people do. We automate workflows by reading and parsing its stdout. This is, for example, how Mercurial's most popular front-end that you somehow failed to mention works: TortoiseHg. We could adapt magit to use hg exactly the same way. Every git command it writes has an hg equivalent. For example, last time I checked, magit stages hunks by creating a patch in memory and sending it to git's stdin, this can be done in hg with something such as cat patch | hg qimport --name staging-area - Writing hg extensions in Python is just a nicer choice for some things if you happen to already like Python. > Mercurial's supporting applications don't seem to improve as quickly > (at least, not those distributed with Mercurial, cf. gitk vs. hg > view). Nobody cares that TortoiseHg isn't distributed with hg, since for many interested people, TortoiseHg bundles hg. > So git is clearly winning the popularity contest, both in general > and on emacs-devel. I don't get this argument. Windows and Mac OS X are also more popular; does this mean we shouldn't use any other OS because all of the cool games are almost exclusively developed on Windows? And Mercurial, despite being less popular, *does* get a lot of toys developed for it too. One that I like that replaces my most frequent usage of magit is crecord: interactively select hunks for committing. > I actually see two features that git doesn't provide (and I don't > know how git would provide them robustly) in Bazaar (bound branches > and mainline-respecting operations). I don't see any in Mercurial. I'm surprised. You've been using hg this long and you haven't seen any new features? Here are a few of hg-only features that are really cool: * revsets: (hg help revsets) hg supports a really cool DSL for querying its history. It's very rich and easy to understand. There's very little syntax to memorise, since it's a language built on simple function calls. It's far richer than what you can get in gitrevisions(7) The resulting queries can be used anywhere in the CLI where a single revision can be used. * Evolve and phases: This git lecture, http://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase is pointless from a pure DVCS point of view. There is nothing that should stop us from "rebasing" as, git calls all DAG modifications, upstream source. In Mercurial, it is possible to collaboratively edit history ("rebase", in git parlance). There are two tools in place for this, phases, which indicate which commits are "safe" to collaboratively edit, and Evolve, which brings forth some tools for automatically handling the conflicts that ensue. In Mercurial, commits carry around extra metadata that propagates across clones and indicates whether this commit has been modified upstream or not. Evolve uses this metadata for automatically fixing any instability that is based on the commits that upstream has modified. * Instant web interface: This one is more well-known. You can do "hg serve" at any time to instantly serve a particular repo over the web. This is supposed to be a lightweight server, so it's not suited to be used alone without nginx or Apache or whatever, but it's good enough for a quick setup between friends. The instant web interface is featureful enough to do most read-only hg operations plus it also allows pushing to the repo it's serving from. There are others that are a little less impressive but just present a nicer interface: hg's templating engine, which is both used for presenting the hg log and for creating custom hgweb designs, being able to push to any repo (i.e. no need for a separate bare repo type), hg outgoing and incoming for seeing what commits will be shared before doing any actual sharing. My point here is that Mercurial is not short of innovation, apparently only short of publicity. So here is some publicity. > Eg, it's hard to see how Mercurial or Bazaar could directly support > a Darcs-like patch type, but in git it's simple: just a pair of > SHA1s. I have only briefly skimmed Darcs' theory of patches. If you're patient enough to explain to me what you hope to accomplish by emulating it, I might enjoy thinking about how to implement it in hg. Since hg has very similar architecture to git and you say this is easy in git, I am certain this is feasible. > Also, people who think in terms of "commit" and "update" being > heavyweight (network) operations tend to insist on associating > commits with development milestones. They deprecate git's > DAG-traversing as useless and DAG-editing as "history modification". No, hg has a lot of ability to modify history or traverse the DAG, as you call it. > Of course, as someone who frequently uses rebase, micro-commits, and > similar techniques in my own workflows, I'm biased. Apparently you're not using them in Mercurial?=20 hg commit --amend hg histedit -r .~3 hg update -r @ hg rebase -b myseries hg crecord Do you know what these tools do? Is there a reason why you don't use them, if you really are not? > But between the growth possibilities inherent in git's simpler, more > extensible architecture, and current workflows that are difficult to > impossible to emulate with other VCSes, I think git is both > technically and by popularity the obvious choice (if Emacs is going > to switch VCSes). Of course I don't dispute that git is more popular, but I do contend that hg is not as small as bzr, and its development status is much more healthy than bzr's. It's also not as obscure as bzr, and given the amount of money that is being pumped into it by several commercial entities, http://mercurial.selenic.com/sponsors/ fears of something like what Canonical did to bzr seem unfounded to me. Mercurial is a good choice, despite being less popular than git. - Jordi G. H.