W3C home > Mailing lists > Public > spec-prod@w3.org > October to December 2011

Re: Using GitHub for specification development

From: Aryeh Gregor <ayg@aryeh.name>
Date: Thu, 10 Nov 2011 13:57:50 -0500
Message-ID: <CAKA+Ax=fuf_2PsP6pxHfXeTmpBCSRWxuSnrWs21cb-A0fhhHhA@mail.gmail.com>
To: Robin Berjon <robin@berjon.com>
Cc: Gregg Kellogg <gregg@kellogg-assoc.com>, "spec-prod@w3.org Prod" <spec-prod@w3.org>
On Thu, Nov 10, 2011 at 6:21 AM, Robin Berjon <robin@berjon.com> wrote:
> On Nov 9, 2011, at 20:55 , Aryeh Gregor wrote:
>> hg-git has turned out to work just fine.  I develop locally in git,
>> then use a publish script to convert to hg and push to dvcs.w3.org, as
>> well as to github.
> Care to share the script?


The relevant bit is:

cd /tmp
hg clone ~/webroot/tmp/editing hg-editing.$$
cd hg-editing.$$
hg push -r master https://dvcs.w3.org/hg/editing
cd ..
rm -rf hg-editing.$$

My working git copy is ~/webroot/tmp/editing, so of course you'll want
to change that (and the dvcs.w3.org URL) as appropriate.  In principle
this shouldn't be necessary -- it should be possible to keep a
persistent hg copy, pull changes from the git copy, and push them to
the central hg copy.  I recreate the hg repository every time instead,
which takes a few minutes, because I was getting cryptic errors when
pulling from the git repo to the hg clone.  I haven't had any problems
with my current technique, except that it's slow.  The commit id's
that hg-git generates seem to be consistent, so there's no problem
when pushing to the existing central repo.

You'll need to install hg-git: http://hg-git.github.com/  Once you do
that, regular commands like hg clone/pull/push will work on git
repositories as well as hg repositories, so they'll clone a git
repository into an hg repository, or push/pull changes from a git repo
to the current hg repo.  The resulting hg repositories can be used
like regular hg repositories.  I believe it's possible to convert back
to git too somehow, but I haven't tried it.  I'd guess you create an
empty git repo with git init, then use hg push to populate it or such.
Received on Thursday, 10 November 2011 18:58:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:55:16 UTC