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

git history in a file

From
JBJosh Boyer <jwboyer@fedoraproject.org>
Date
Jul 24, 2015, 12:16 UTC
Message-ID
<CA+5PVA6S69ZU5Q432PK3DiPGkT=00tAtgSzJaYHyXLkHkg9FHw@mail.gmail.com>
Hello,

I'm trying to figure out how to generate a file that contains the git history and changes from one revision to another, such that when the file is applied to a different tree starting at the same ancestor, the resulting tree is identical.

E.g. git <whatever> v4.2-rc3..master
would produce this file, and then:
git <apply whatever> <file>
run on a tree which is currently at 4.2-rc3 would result in an identical HEAD.

Originally I thought git-format-patch would be sufficient, however it does not contain merge commits and the resulting commit shas seem like they would be inaccurate. Is there a way to do this?

I realize one could just git fetch/pull from tree A to tree B, but the usecase here is more complicated. Please CC me on replies as I am not subscribed.

josh
Next: Andreas Schwab
Message 1 of 3 in “git history in a file”
  1. Josh BoyerJul 24, 2015
  2. Andreas SchwabJul 24, 2015
  3. Josh BoyerJul 24, 2015

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.