From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Geisler Newsgroups: gmane.emacs.devel Subject: Re: preferring mercurial Date: Wed, 15 Jan 2014 17:07:11 +0000 (UTC) Message-ID: References: <3905544.suqMZffgM5@descartes> <874n5d6whz.fsf@gaia.iap.fr> <87iottf4fe.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: 8bit X-Trace: ger.gmane.org 1389805661 9804 80.91.229.3 (15 Jan 2014 17:07:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 17:07:41 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 15 18:07:49 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 1W3TwT-00034P-AD for ged-emacs-devel@m.gmane.org; Wed, 15 Jan 2014 18:07:49 +0100 Original-Received: from localhost ([::1]:56125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3TwS-0001nw-JT for ged-emacs-devel@m.gmane.org; Wed, 15 Jan 2014 12:07:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3TwK-0001nb-3K for emacs-devel@gnu.org; Wed, 15 Jan 2014 12:07:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3TwE-0007Ic-Bc for emacs-devel@gnu.org; Wed, 15 Jan 2014 12:07:40 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:60664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3TwE-0007IE-4y for emacs-devel@gnu.org; Wed, 15 Jan 2014 12:07:34 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W3TwC-0002UX-OB for emacs-devel@gnu.org; Wed, 15 Jan 2014 18:07:32 +0100 Original-Received: from 50.56.228.100 ([50.56.228.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jan 2014 18:07:32 +0100 Original-Received: from martin by 50.56.228.100 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jan 2014 18:07:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 85 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 50.56.228.100 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:168471 Archived-At: Stephen J. Turnbull xemacs.org> writes: > > François Orieux writes: > > > My resume of all the posts I have read is that git and hg are > > technically equivalent. > > AFAICS they are very much *not* technically equivalent. They may be > equal in power, especially at the UI level, but git exposes a much > cleaner interface to the internal model of blobs (file content), trees > (file directories), and commits *to the user*. Whether that is a good idea or not is debatable :) > This means that git is more hackable: you can script it with shell, Did you know that the official API for Mercurial is it's command line interface? That means that scripting it with a shell script is not just possible but even recommended. There are libraries for a number of languages that gives you a higher level API: http://mercurial.selenic.com/wiki/CommandServer#Libraries There are a number of "debug" commands that you can use to expose the internal structure of the changelog, the manifests, and the filelogs (like Git, Mercurial also stores the data in a 3-level structure.) > you can script it with Python, you can script it with Emacs Lisp, or > you can write C. Bzr definitely loses big here: the internals are > layer upon layer upon layer of complex Python API. I don't know about > Mercurial, haven't looked at its internals. Git invites you to play > with the DAG, just as Lisp invites you to play with lists. > > Is this *better*? That's a matter of taste. But different? Definitely. > > > Hg is cleaner, easier with better doc and ui > > I disagree, but again it's a matter of taste. > > > with a bigger respect of history. > > That is a lie, and you should stop repeating it, and tell people who > try to tell it to you to stop, too. > > Nothing has more respect for history than git. Using git, you can > forget history (by deleting or moving refs) but you can't change it or > delete it.[1] That's why git doesn't have backups (the way hg and bzr > save bundles if you do a "commit --amend" or a "strip") for the > operations that fans of other VCS call "history-changing" -- it > doesn't need them. History isn't *changed*, it is recreated -- and > the original history remains accessible to the user. AFAIK hg and bzr > *do* destroy history when they perform operations like commit --amend, > strip, and rebase. For sure, git *does not*. (Mercurial developer here.) I can assure you that Mercurial works the same way: when you amend or rebase, you *recreate* history. It *must* work like this since Mercurial (just like Git) uses recursive SHA-1 hashing to determine the ID for each commit. The old history is not destroyed, but it is currently moved out of the repository proper -- it is moved into the bundles you mention above. That makes it possible to restore it with 'hg pull .hg/strip-backup/your-bundle' I agree that this is not as nice as merely hiding the old history like Git does. It's also not as efficient since we have to move data around when creating the bundle. This is why we're working hard on making Mercurial *hide* the old history instead of moving it into bundles. The code is currently in an extension that you can enable: http://mercurial.selenic.com/wiki/ChangesetEvolution I've been using it for a year now and this means that all my rebased and amended commits are still present in the repository and 'hg log --hidden' will show them. > It's true that you can alter the presentation of history in git > relatively easily compared to other VCSes. But it's possible in them, > too, and (AFAIK) in them it does destroy original history in the > process of remaking it. Not 100% accurate for Mercurial today and it will be plain wrong in the future. -- Martin Geisler