From: Brian Gernhardt <benji@silverinsanity.com>
To: H Merjin Brand <h.m.brand@xs4all.nl>
Cc: Git List <git@vger.kernel.org>,
Lars Noschinski <lars-2008-1@usenet.noschinski.de>
Subject: Re: Merging submodules (was Re: Feature suggestion: git-hist)
Date: Wed, 30 Jul 2008 19:03:37 -0400 [thread overview]
Message-ID: <20080730230336.GA6481@Hermes> (raw)
This message got eaten by a syntax error somewhere. This is a re-send, sorry for any duplicate messages.
On Jul 30, 2008, at 12:26 PM, H.Merijn Brand wrote:
> On Wed, 30 Jul 2008 11:15:55 -0400, Brian Gernhardt
> <benji@silverinsanity.com> wrote:
>
> > 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.
Hm. I did mention this was completely untested, yes? The problem comes
from the fact that '-s ours' wants to use HEAD, not the index. But you
can't amend a normal commit into a merge, apparently. And I don't think
you want a commit that adds the files and a commit that "does the merge"
as two separate steps.
Well, I don't know how to make the porcelain do this then. But the
plumbing can definitely do it. Hopefully someone more used to doing
strange things like this can give a simpler recipe, but this should
work.
# First reset to the commit you made with all the modules added.
vim commit-message # Create a merge message
commit=$(git commit-tree HEAD: -p HEAD^ -p module_a/master -p
module_b/master -p module_c/master < commit-message)
git update-ref HEAD $commit # Update your current ref
~~ Brian
next reply other threads:[~2008-07-30 23:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 23:03 Brian Gernhardt [this message]
2008-07-31 7:21 ` Merging submodules (was Re: Feature suggestion: git-hist) H.Merijn Brand
2008-07-31 12:39 ` Merging submodules H.Merijn Brand
2008-07-31 13:06 ` Petr Baudis
2008-07-31 15:01 ` H.Merijn Brand
2008-07-31 15:24 ` Santi Béjar
2008-07-31 18:15 ` H.Merijn Brand
2008-07-31 19:03 ` Santi Béjar
2008-07-31 20:44 ` H.Merijn Brand
2008-08-01 7:04 ` H.Merijn Brand
2008-08-01 9:52 ` Santi Béjar
2008-08-01 10:35 ` H.Merijn Brand
2008-08-01 11:34 ` Santi Béjar
2008-08-04 13:24 ` H.Merijn Brand
2008-08-04 13:40 ` Petr Baudis
2008-08-04 13:57 ` H.Merijn Brand
2008-08-04 14:06 ` Petr Baudis
2008-07-31 13:17 ` Santi Béjar
-- strict thread matches above, loose matches on Subject: below --
2008-07-30 11:38 Feature suggestion: git-hist H.Merijn Brand
2008-07-30 13:33 ` Lars Noschinski
2008-07-30 13:58 ` H.Merijn Brand
[not found] ` <FA2D570A-B2B1-4994-AA6A-9C0C55E69900@silverinsanity.com>
2008-07-30 16:26 ` Merging submodules (was Re: Feature suggestion: git-hist) 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=20080730230336.GA6481@Hermes \
--to=benji@silverinsanity.com \
--cc=git@vger.kernel.org \
--cc=h.m.brand@xs4all.nl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.