Boost logo

Boost :

Subject: Re: [boost] [git] Mercurial?
From: Julian Gonggrijp (j.gonggrijp_at_[hidden])
Date: 2012-03-27 08:15:50


Stephan Menzel wrote:

> On Tue, Mar 27, 2012 at 10:52 AM, Joel de Guzman
> <joel_at_[hidden]> wrote:
>
>> Ok, I open my challenge to you and any Git/Hg fans.
>>
>> Again, all I want is to:
>>
>> 1) Extract this modular repo structure from Boost:
>>
>> spirit
>> boost
>> spirit
>> libs
>> spirit
>
> Easily doable
>
>> 2) that can merge both ways (upstream and downstream
>> to and from the boost SVN trunk); needless to say, with all
>> the histories intact.
>
> Not at all doable. As I said, one may be able to hack this or make it
> work but it's not a defined or supported way of working with it. And
> using such a system in a way that defies its intended way of being
> used is pointless and will only support those who claim git itself is
> not a good thing.
> Sure, you may be able to cut your fingernails with a chainsaw but life
> is just better and a little safer if you don't do it and it adds to
> the chainsaw's reputation to a way that it doesn't deserve.

Just because I could think of a way, here's a "cut your fingernails
with a chainsaw" approach (excellent formulation by the way). Using
multiple git repositories:

- a git-svn mirror of the Boost trunk;
- a subtree repository for just /boost/spirit
- a subtree repository for just /libs/spirit
- optionally, more subtree repositories;
- the actual modular repo for Spirit, on which you do your work,

To merge upstream (assuming you don't edit non-Spirit subtrees):
 (on modular repo)
    git-subtree-push to the /boost/spirit repo
    git-subtree-push to the /libs/spirit repo
 (on trunk mirror)
    git-subtree-pull from the /boost/spirit repo
    git-subtree-pull from the /libs/spirit repo
    git-svn-push to the Boost trunk

To merge downstream:
 (on trunk mirror)
    git-svn-pull from the Boost trunk
    git-substree-push to the /boost/spirit repo
    git-substree-push to the /libs/spirit repo
    git-substree-push to the other subtree repos
 (on modular repo)
    git-subtree-pull from the /boost/spirit repo
    git-subtree-pull from the /libs/spirit repo
    git-subtree-pull from the other subtree repos

It would need some scripts (perhaps triggers) to make it doable, and
then it would still not be elegant, but I believe it could work. It
would take some care because each commit must edit only a single
subtree (I don't think the system would break otherwise, but you
might introduce sibling commits with the same commit message as an
artifact). I also expect new commits will appear in a different order
after you merge upstream or downstream, i.e. stably sorted by
subtree, but history will not be altered afterwards on either side of
the "subtree bridge". This might need clarification---if so, please
poke me.

I've not implemented this idea, both because I'm short on time and
because I think it's best to wait for insights of other people first.
I wouldn't be surprised if the entire idea is hopeless for reasons I
haven't thought of.

As Daniel pointed out, the entire thing will be slightly easier to
handle if people only contribute to Spirit through the modular git
repo.

-Julian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk