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

Re: More help needed on merging unrelated repos

From
Christian MICHON <christian.michon@gmail.com>
Date
Nov 6, 2008, 12:13 UTC
Message-ID
<46d6db660811060413q7f4e2437maa6d87a27b8704b@mail.gmail.com>
In-Reply-To
<20081106083751.GA10359@diana.vm.bytemark.co.uk>
On Thu, Nov 6, 2008 at 9:37 AM, Karl Hasselström <kha@treskal.com> wrote:
Show 29 quoted lines
> On 2008-11-04 23:30:56 +0100, Christian MICHON wrote:
>
>> note the merge can work, but it's still done in 2 steps. :(
>> thanks for suggesting this.
>
> If it had worked, you'd have gotten just one merge commit. What you
> want to do is entirely possible, but it seems the high-level commands
> were not designed with your use-case in mind.
>
> Another thing you could try is to merge the two branches separately,
> getting a history like this:
>
>  p1----\
>         \
>  p2---A--B
>      /
>  p3--
>
> And then use grafts to convince git that B has parents p1, p2, and p3
> (instead of its actual parents p1 and A). (Grep for "graft" in the
> Documentation directory.)
>
> And then use git-filter-branch to rewrite history so that the grafted
> history becomes the real history.
>
> --
> Karl Hasselström, kha@treskal.com
>      www.treskal.com/kalle
>

nice suggestion Karl! it took a while to understand all the consequences and workflow. On top of your suggestion, I had to remove the refs/original/refs/heads/master and the grafts file.

It worked well: quite a spell, but an efficient one. Kudo++
-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
Previous: Karl HasselströmNext: Karl Hasselström
Message 7 of 8 in “More help needed on merging unrelated repos”
  1. Christian MICHONNov 4, 2008
  2. Andreas EricssonNov 4, 2008
  3. Christian MICHONNov 4, 2008
  4. Andreas EricssonNov 4, 2008
  5. Christian MICHONNov 4, 2008
  6. Karl HasselströmNov 6, 2008
  7. Christian MICHONNov 6, 2008
  8. Karl HasselströmNov 6, 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.