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

Re: Embedded Linux development with GIT

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Jul 5, 2007, 07:10 UTC
Message-ID
<468C996B.7FEFEB29@eudaptics.com>
In-Reply-To
<a2e879e50707042250w22fe570cp4dda316e6b0f4cea@mail.gmail.com>
Sean Kelley wrote:
Show 26 quoted lines
> 
> Hi,
> 
> I have a situation where we have a local GIT repository that is based
> on v2.6.17.  We initially added the source tarball to an empty
> repository and then started applying changes to it.  Looking back,
> that might not have been the best idea 400 commits later.
> 
> My goal is to eventually bring our repository closer to mainline
> revisions so as to make it easier to actually contribute back to the
> community.  So how can I fix my repository so as to give it visibility
> to Linus' kernel?
> 
> Here is my initial thoughts:
> 
> 1) Clone kernel.org kernel and it is Master
> 2) Create a local Head based on 2.6.17 and call it Local
> 3) Pull my existing heavily patched repository into the Local branch and merge
> 
> Is it possible then to see our 400 odd commits then in the Local
> branch on top of 2.6.17 so that we can see not only our history but
> also the history that came before?  Then as Master advances we can see
> about backporting and bringing our code close enough to mainline
> kernel to actually be able to contribute back to the community and
> submit patches.  Is this realistic approach.  I am unsure of the GIT
> commands that I need to do this?
That is possible using a graft:
  $ echo "$x $(git rev-parse v2.6.17^0)" >> .git/info/grafts

where $x is the SHA1 of the first commit you made on top of the imported tarball. This way you have spliced your history with Linus's history. (This is a strictly _local_ matter! Every clone of your history must repeat the game!)

Now, Linus will not be able to pull from your faked history because he doesn't know about the graft. In order to fix that, you can run git-filter-branch from current git's master branch to rewrite your history:

  $ git filter-branch new-master v2.6.17..master

Read the man page of git-filter-branch, and understand the implications before you publish the result.

-- Hannes
Previous: Alex RiesenNext: Johannes Schindelin
Message 4 of 5 in “Embedded Linux development with GIT”
  1. Sean KelleyJul 5, 2007
  2. Dan ChokolaJul 5, 2007
  3. Alex RiesenJul 5, 2007
  4. Johannes SixtJul 5, 2007
  5. Johannes SchindelinJul 5, 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.