From: "Ping Yin" <pkufranky@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "Alex Riesen" <raa.lkml@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: How to change a submodue as a subdirectory?
Date: Fri, 16 Nov 2007 00:41:05 +0800 [thread overview]
Message-ID: <46dff0320711150841g1ec2a238r7fe5650e8cfaee03@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0711151322590.16728@wbgn129.biozentrum.uni-wuerzburg.de>
On Nov 15, 2007 8:28 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > 1. move submodule subB outside
> > mv subB /newpath/to/subB
> > git-commit subB
>
> Strictly speaking, you do not have to move it outside.
Hmm, you're right. I can just just remove it after fetch subB as a
branch of superA.
>
> > 2. git-filter-branch to rename all files in subA repository to subB
> > directory (say subB/subB).
> >
> > cd newpath/to/subB &&
> > git filter-branch --index-filter \
> > 'git ls-files -s | sed "s-\t-&subB/-" |
> > GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
> > git update-index --index-info &&
> > mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
>
> No need to play games with GIT_INDEX_FILE, as far as I can tell.
I just follow the example of git-filter-branch manual page. If not
using GIT_INDEX_FILE.new, the GIT_INDEX_FILE will be read and wirtten
at the same time since it is read and writtern at the same in a pipe.
Will this be ok?
>
> > 3. in directory of super project superA, git-fetch repository subB to
> > branch subB
> > cd path/to/superA && git-fetch /newpath/to/subB master:subB
>
> If you plan to do away with subB, you do not need to specify it... Just
> use FETCH_HEAD, directly after the fetch.
Hmm, using FETCH_HEAD is really better.
> The git-cherry call is not really necessary, right? The two repos have no
> common history (not even common patches).
>
> Besides, I think that what you did is just a complicated way of doing a
> rebase.
I tried rebase, wonderful!
>
> Ciao,
> Dscho
>
>
--
Ping Yin
prev parent reply other threads:[~2007-11-15 16:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-14 14:37 How to change a submodue as a subdirectory? Ping Yin
2007-11-14 20:26 ` Alex Riesen
2007-11-15 5:36 ` Ping Yin
2007-11-15 6:16 ` Johannes Schindelin
2007-11-15 8:14 ` Ping Yin
2007-11-15 12:28 ` Johannes Schindelin
2007-11-15 16:41 ` Ping Yin [this message]
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=46dff0320711150841g1ec2a238r7fe5650e8cfaee03@mail.gmail.com \
--to=pkufranky@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=raa.lkml@gmail.com \
/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).