This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 1-800-GIT-HELP question
- From: Matthew Malcomson <Matthew dot Malcomson at arm dot com>
- To: Gaius Mulley <gaius dot southwales at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 15 Jan 2020 10:44:56 +0000
- Subject: Re: 1-800-GIT-HELP question
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8u+Y9zdVO2crpWkJ1I/28NLVS81AqOnh0FFzE9UVFsY=; b=NsOPEr16fapjhovtayObUM/wn8y0lSgcTEvypErW60vDfOOnY/vln2G1Nuws5N2K2JRJ6byJApXaeU3iAouCLeKAXp3Z/FAFKTNevVtmlaHjy3VRwO2in3WHtmpqYqevOwMRK+uOGPfNu+ifnjxgG6EjB8TeVcn6Jn7hRgUWMa0VLzMabmQol30qdaTFkmuaqQuzEE6hLf9jpGbRsiMr++gVBFpUE4YJdYupbQw3ti2itjcUczFlWa3TSAWXk0zAoK4acrX9T6ip8BUqwTWEfx/RTRtTC5V2zxc6tuESSf1RgrV6pp++q8UJsQzShTlH/Oxt5ThJhP3I34IF3bOfSA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BbQHfmwaDWKm8tpFttzqN+NFIkLMNbyj821A+rf5kg8/LPLzwKEL4lwLqrkq5Jmu8X6hjMyJKhR18t5KJVn1vcxxhyFy8tjC3YVdSm3OdBEB73uYUPgrnSMp4BE16KPc3+ScZq4VJY8vI2uqxKoHcPTlkVESV8JUDxI5PHvWDAucZAXgi64sEJc8oem3Sg2+Ma8PLbc3w/VoYWgYwfK77Msl+Z1RyJs+3ensIgjYaF3nutXanslyMMuf0cAzozLv03CSSmIX46o6k5+nnaB8qJLnkccoywkF2j66xA2ONFj89EelLLJfQ636CirGinV51sMhRCngEEPf/zB+rdyj/g==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Matthew dot Malcomson at arm dot com;
- References: <87v9pdm3hm.fsf@gmail.com>
On 15/01/2020 10:13, Gaius Mulley wrote:
>
> Hello,
>
> Firstly many thanks to all who have worked on the git migration and also
> for the offer of help :-)
>
> I'm seeking a little advice on an efficient way to combine the gm2 git
> repro with the gcc git repro. When gcc was using subversion I had a
> script which untared the gm2 git over the subversion, applied local
> patches to the gcc tree and then it was ready for use. I could git diff
> in the gm2 tree and svn diff in the gcc tree - etc.
>
> I wonder if a similar model can be achieved now gcc uses git?
>
> In essence the gm2 front end adds three subtrees to gcc
>
> libgm2
>
> gcc/m2
>
> gcc/testsuite/gm2
>
> currently these are all in one repro
> gm2/gcc-versionno/{libgm2,gcc/m2,gcc/testsuite/gm2}.
>
> http://git.savannah.gnu.org/cgit/gm2.git/tree
>
> I'm a little cautious of choosing an initial working model without
> knowing the implications. There seem to be many possible solutions
> (subtree, submodule) to name but two.
>
> Disk space is not a concern, the time to recreate a working tree is more
> important.
>
> regards,
> Gaius
>
I'm not sure if you even can use a subtree/submodule at the top level --
I'm under the impression that when creating one you need to put the
entire other repository in a subdirectory.
(If that's wrong please correct me -- it sounds like it might be useful
;-) )
Maybe you could look into the `--work-tree` and `--git-dir` options?
One approach would be to have your gm2 repository information under
`.gm2-git` and your gcc repository information under `.git`.
Then you might be able to create an alias for git that means `git gm2`
expands to `git --git-dir=$(root directory)/.gm2-git` and everything
should just work.
(I say might since I'm not 100% sure you can expand to `root directory`
automatically in a git alias -- maybe through another git alias that
says `root = !pwd`).