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
Nov 18, 2008, 09:24 UTC
Message-ID
<492289B0.4010903@drmicha.warpmail.net>
In-Reply-To
<200811171645.12869.bss03@volumehost.net>
Boyd Stephen Smith Jr. venit, vidit, dixit 17.11.2008 23:45:
Show 36 quoted lines
> I haven't gotten a response from my subscription email, so please CC me on any replies.
> 
> So, I've been managaing the source I had from a client project in git and 
> have a non-linear history.  Currently, two tips (production and testing) 
> but there are many feature branches that were git-merge'd in, not rebased.
> 
> Now, I've gotten the full tree.  Turns out all the source code I was 
> working on was in a subdirectory "project/web".  I'd like to "graft" the 
> *changes* I made onto the full tree.
> 
> I figured this might be a job for git-filter-branch.  Certainly, that did 
> the job of moving all my changes into the subdirectory.  But, now I want to 
> do something that's a combination or git-rebase and git-filter-branch.  I 
> want to replay the *patches/deltas* (like rebase) on top of the full tree I 
> have, but *maintain the non-liear history* (like filter-branch).
> 
> Can anyone think of a recipe for me?
> 
> Trees look something like this right now.
> 
> <some history> -> FT
> 
> TI -> <non-linear history> -> A -> <non-linear history> -> C
>    \                            \                           \
>     -> PI ------------------------> B ------------------------> D
> 
> I'd like to have it look something like:
> 
> <some history> -> FT -> <non-linear history> -> A' -> <non-linear history> -> C'
>                     \                            \                           \
>                      -> PI' ----------------------> B' -----------------------> D'
> 
> A', B', C', and D' are different commits, but the diff (and history) between 
> FT and A' is the same as the diff (and history) between TI and A.
> 
> Again, please CC me on any replies.
[CCing is customary here anyways.]

So, your base directory for TI and FT is different, right? I.e.: In the TI repo, your project sits at the root, whereas in the FT repo it sits in project/web? Has FT advanced since you took the initial subdir snapshot for TI?

Michael
Previous: Boyd Stephen Smith Jr.Next: Boyd Stephen Smith Jr.
Message 2 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.