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

Re: incorporating the past

From
Junio C Hamano <junkio@cox.net>
Date
Apr 9, 2007, 19:59 UTC
Message-ID
<7vejmtz5dd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87d52d1kli.fsf@mid.thomas-huehn.de>
Thomas Hühn <newsgroups@thomas-huehn.de> writes:
Show 6 quoted lines
> Can I just do another git init for 0.1, commit the changes up to 1.0 and
> merge those two histories? Don't I need a common ancestor for both or
> something like that?
>
> Or can I do the same, only up to 0.9 instead of 1.0, and then "sew
> together" those histories?
Yes. you can "graft" two distinct histories together.

You already have v1.0..v1.6 history. You create v0.1..v0.9 history the same way, perhaps in a separate repository.

Then, you tell git to pretend that the v1.0, which in reality does not have any parent (i.e. "git cat-file commit v1.0" does not have any "parent" line), has one parent that is v0.9, by creating a file .git/info/grafts. The file should list two commit object names (v1.0 first and then v0.9) separated with a single SP and then terminated with a single LF. Each line of this file says "this commit (the first one on the line) has the following parents (the rest)".

Previous: Shawn O. Pearce
Message 3 of 3 in “incorporating the past”
  1. Thomas HühnApr 9, 2007
  2. Shawn O. PearceApr 9, 2007
  3. Junio C HamanoApr 9, 2007

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.