unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jordi Gutiérrez Hermoso" <jordigh@octave.org>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: David Kastrup <dak@gnu.org>, emacs-devel@gnu.org
Subject: Re: Prefer Mercurial instead of git
Date: Sun, 05 Jan 2014 08:19:27 -0500	[thread overview]
Message-ID: <1388927967.11337.32.camel@Iris> (raw)
In-Reply-To: <8738l2k4hh.fsf@uwakimon.sk.tsukuba.ac.jp>

On Sun, 2014-01-05 at 21:17 +0900, Stephen J. Turnbull wrote:
> Jordi Gutiérrez Hermoso writes:

>  > And I think Mercurial is a good choice, and I will choose it again,
>  > and again.
> 

> 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? 

    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.





  reply	other threads:[~2014-01-05 13:19 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03 21:52 Prefer Mercurial instead of git Jordi Gutiérrez Hermoso
2014-01-04 10:11 ` David Kastrup
2014-01-04 10:20   ` David Engster
2014-01-04 10:33   ` Eric S. Raymond
2014-01-04 13:13   ` Jordi Gutiérrez Hermoso
2014-01-04 13:29     ` David Engster
2014-01-04 14:23     ` David Kastrup
2014-01-04 14:38       ` Jordi Gutiérrez Hermoso
2014-01-04 15:19         ` David Kastrup
2014-01-04 15:24           ` Jordi Gutiérrez Hermoso
2014-01-04 16:51             ` David Engster
2014-01-04 17:16               ` Jordi Gutiérrez Hermoso
2014-01-04 17:31                 ` David Engster
2014-01-04 17:40                   ` Jordi Gutiérrez Hermoso
2014-01-04 18:34                     ` Alan Mackenzie
2014-01-04 19:26                       ` Óscar Fuentes
2014-01-04 20:18                       ` Stefan Monnier
2014-01-05 11:07                     ` Leo Liu
2014-01-04 17:35                 ` Eli Zaretskii
2014-01-04 18:25                   ` Paul Eggert
2014-01-04 20:03                     ` Eli Zaretskii
2014-01-06 12:26                       ` Darren Hoo
2014-01-06 14:58                         ` Stefan Monnier
2014-01-06 17:44                         ` Eli Zaretskii
2014-01-06 19:33                         ` Paul Eggert
2014-01-04 14:40       ` Jordi Gutiérrez Hermoso
2014-01-05 12:17         ` Stephen J. Turnbull
2014-01-05 13:19           ` Jordi Gutiérrez Hermoso [this message]
2014-01-05 13:25             ` Florian Weimer
2014-01-05 13:55               ` Jordi Gutiérrez Hermoso
2014-01-05 15:38             ` Óscar Fuentes
2014-01-05 16:18               ` Jordi Gutiérrez Hermoso
2014-01-05 16:41                 ` Eric S. Raymond
2014-01-05 17:09                 ` Óscar Fuentes
2014-01-05 23:26                   ` Jordi Gutiérrez Hermoso
2014-01-06  0:38                     ` Óscar Fuentes
2014-01-06  1:01                       ` Jordi Gutiérrez Hermoso
2014-01-06  0:03                 ` David Kastrup
2014-01-05 17:54             ` Stephen J. Turnbull
2014-01-05 23:03               ` Dov Feldstern
2014-01-05 23:23                 ` Karl Fogel
2014-01-05 23:37                   ` Dov Feldstern
2014-01-06  4:02                     ` Stephen J. Turnbull
2014-01-05 13:56           ` David Kastrup
2014-01-04 14:12 ` Rüdiger Sonderfeld
2014-01-04 16:08   ` Sebastian Wiesner
2014-01-04 16:41     ` Jordi Gutiérrez Hermoso
2014-01-04 18:37       ` David Kastrup
2014-01-04 18:44         ` Alan Mackenzie
2014-01-04 19:04         ` Jordi Gutiérrez Hermoso
2014-01-04 19:30           ` Óscar Fuentes
2014-01-05 16:23             ` Eli Zaretskii
2014-01-05 16:46               ` Eric S. Raymond
2014-01-05 17:03                 ` Eli Zaretskii
2014-01-05 16:52               ` Óscar Fuentes
2014-01-05 17:17                 ` Eli Zaretskii
2014-01-05 17:55                   ` Óscar Fuentes
2014-01-05 18:07                     ` Eli Zaretskii
2014-01-05 18:54                       ` Óscar Fuentes
2014-01-05 21:07                     ` Sean Sieger
2014-01-06  0:12                   ` David Kastrup
2014-01-06  0:21                     ` Rostislav Svoboda
2014-01-06  0:30                       ` Karl Fogel
2014-01-06  2:24                         ` Jay Belanger
2014-01-06 16:51                           ` Karl Fogel
2014-01-06 17:13                             ` Jay Belanger
2014-01-06  3:47                     ` Eli Zaretskii
2014-01-05  3:13         ` Jay Belanger
2014-01-05 17:16       ` Sebastian Wiesner
2014-01-06  0:17         ` David Kastrup
2014-01-05  2:14 ` Karl Fogel
  -- strict thread matches above, loose matches on Subject: below --
2014-01-06 13:08 grischka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1388927967.11337.32.camel@Iris \
    --to=jordigh@octave.org \
    --cc=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stephen@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).