git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Grafting mis-aligned trees.

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 2, 2008, 17:38 UTC
Message-ID
<493572A3.4070205@drmicha.warpmail.net>
In-Reply-To
<200812021119.51857.bss03@volumehost.net>

Boyd Stephen Smith Jr. venit, vidit, dixit 02.12.2008 18:19: ...

> It does feel a bit "hacky", I was hoping git would have better support 
> this, through the subtree merge or something else.  It seems like 
> something that might happen to others, perhaps as a side-effect of a 
> failed attempt at using submodules.
Well, except for 'tar' my solution uses only git commands ;)
> I can't help thinking that rebase -ip might have helped.  I wasn't aware 
> of -p when I was initially working on this problem.  (It doesn't help that 
> I generally use Debian stable, and git 1.4 did not have -p.)

rebase rebases one branch at a time, but you need to rebase/rewrite several, and the merge info between depends on rewritten sha1s.

...
> I probably don't need the -f.  If there are files that should be ignored 
> (and thus shouldn't be in the repo), I'll filter-branch to cut them out of 
> the history at some point.

'-f' is about not having to clean out refs/original from a previous filter-branch run.

> What *exactly* is the subtree merge.  The documentation I've read sounds 
> like this case, sort of, but it's rather unclear to me.

I think 'subtree' does what you want, but 'merge' doesn't! 'subtree' saves you the rewriting (putting TI into project/web), but you want a one-time conversion anyway. 'subtree' allows you to repeatedly merge branches with a different root. What it does is it looks for subdir, 'rewrites' the incoming tree automatically and merges the result.

But you don't want a merge, do you? Or else your whole TI history would be tacked onto FT's head "to the left": a new (subtree) merge commit would have FT's and TI's head as parents. This is one way of storing TI history in the full repo, but not the one you said you wanted.

Michael
Previous: Boyd Stephen Smith Jr.Next: Boyd Stephen Smith Jr.
Message 6 of 7 in “Grafting mis-aligned trees.”
  1. Boyd Stephen Smith Jr.Nov 17, 2008
  2. Michael J GruberNov 18, 2008
  3. Boyd Stephen Smith Jr.Nov 28, 2008
  4. Michael J GruberDec 2, 2008
  5. Boyd Stephen Smith Jr.Dec 2, 2008
  6. Michael J GruberDec 2, 2008
  7. Boyd Stephen Smith Jr.Dec 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.