From: "H.Merijn Brand" <h.m.brand@xs4all.nl>
To: Brian Gernhardt <benji@silverinsanity.com>
Cc: Lars Noschinski <lars-2008-1@usenet.noschinski.de>, git@vger.kernel.org
Subject: Re: Merging submodules (was Re: Feature suggestion: git-hist)
Date: Wed, 30 Jul 2008 18:26:48 +0200 [thread overview]
Message-ID: <20080730182648.393cfccc@pc09.procura.nl> (raw)
In-Reply-To: <FA2D570A-B2B1-4994-AA6A-9C0C55E69900@silverinsanity.com>
On Wed, 30 Jul 2008 11:15:55 -0400, Brian Gernhardt
<benji@silverinsanity.com> wrote:
>
> On Jul 30, 2008, at 9:58 AM, H.Merijn Brand wrote:
>
> > One (very) big disadvantage of SCCS is that commits are on a per-
> > file
> > basis, and only in a single directory. This drawback still haunts me
> > in
> > git, as my first attempts to convert were successful in a single
> > folder
> > and git cannot merge folders into a single project.
> >
> > Say I now have
> >
> > /work/src/project/.git
> > /work/src/project/module_a/.git
> > /work/src/project/module_b/.git
> > /work/src/project/module_c/.git
> >
> > Which are all converted repos from SCCS, I'd like to merge the three
> > module_# repos into the top level repo.
>
> Following the example of Linus, the following is completely untested.
>
> First you fetch all of the heads/tags/etc into the superproject with
> commands like
>
> git fetch module_a refs/heads/*:refs/remotes/module_a/*
> git fetch module_b refs/heads/*:refs/remotes/module_b/*
> git fetch module_c refs/heads/*:refs/remotes/module_c/*
All went well
> Then you do something like:
>
> rm -rf module_{a,b,c}/.git # Do this in a test repository, obviously...
> git add module_a module_b module_c
> git commit # Needed because '-s ours' uses current HEAD, not index
So far so good.
> git merge --no-commit -s ours module_a/master module_b/master module_c/master
$ git merge --no-commit -s ours fnc/master i00f000/master
i99f000/master include/master l00m000/master l01f000/master l02f000/master l03f000/master l06f000/master l90z000/master leerpl/master mutbev/master prtabel/master rpt/master tabellen/master zoomen/master Automatic merge went well; stopped before committing as requested
> git commit --amend
$ git commit --amend
fatal: You are in the middle of a merge -- cannot amend.
$ git status
# On branch master
nothing to commit (working directory clean)
When I start git-gui, it still shows a long commit message:
Merge commit 'fnc/master'; commit 'i00f000/master'; commit 'i99f000/master'; commit 'include/master'; commit 'l00m000/master'; commit 'l01f000/master'; commit 'l02f000/master'; commit 'l03f000/master'; commit 'l06f000/master'; commit 'l90z000/master'; commit 'leerpl/master'; commit 'mutbev/master'; commit 'prtabel/master'; commit 'rpt/master'; commit 'tabellen/master'; commit 'zoomen/master'
All other areas are clear
> From this point on, the project repository has a merged history of
> the sub-projects, and if anyone doesn't catch up and still makes a
> commit on a subproject you can use "git merge -s subtree" to merge it
> in anyway.
>
> You may need to "git rm --cached" some files after the "git add" step
> if your .gitignore files aren't perfect.
--
H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
next prev parent reply other threads:[~2008-07-30 16:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 11:38 Feature suggestion: git-hist H.Merijn Brand
2008-07-30 12:03 ` Pieter de Bie
2008-07-30 12:14 ` H.Merijn Brand
2008-07-30 13:33 ` Lars Noschinski
2008-07-30 13:58 ` H.Merijn Brand
2008-07-30 14:55 ` Miklos Vajna
2008-07-30 15:03 ` H.Merijn Brand
2008-07-30 15:23 ` Santi Béjar
2008-07-30 15:58 ` Avery Pennarun
2008-07-30 16:34 ` Lars Noschinski
2008-07-30 15:18 ` Santi Béjar
2008-07-30 15:29 ` H.Merijn Brand
[not found] ` <FA2D570A-B2B1-4994-AA6A-9C0C55E69900@silverinsanity.com>
2008-07-30 16:26 ` H.Merijn Brand [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-07-30 23:03 Merging submodules (was Re: Feature suggestion: git-hist) Brian Gernhardt
2008-07-31 7:21 ` H.Merijn Brand
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080730182648.393cfccc@pc09.procura.nl \
--to=h.m.brand@xs4all.nl \
--cc=benji@silverinsanity.com \
--cc=git@vger.kernel.org \
--cc=lars-2008-1@usenet.noschinski.de \
/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.
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 NNTP newsgroup(s).