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

Re: combine git repo historically

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 11, 2009, 13:07 UTC
Message-ID
<200910111507.06926.j.sixt@viscovery.net>
In-Reply-To
<m31vlagvtw.fsf@localhost.localdomain>
On Sonntag, 11. Oktober 2009, Jakub Narebski wrote:
Show 7 quoted lines
> Christian Couder <chriscool@tuxfamily.org> writes:
> > $ git checkout -b repo1-branch1 remote/repo1/branch1
> > $ git checkout N -- .
> > $ export GIT_AUTHOR_NAME=<author name of commit N>
> > $ export GIT_AUTHOR_EMAIL=<author email of commit N>
> > $ export GIT_AUTHOR_DATE=<date of commit N>
> > $ git commit -a

This would not preserver the committer, but in particular the committer date is rather important for history traversal. You really don't want to change it. I used a much more elaborate pipleine involving git-commit-tree because I did not think about this simple procedure:

>  $ git cat-file commit N > COMMIT_N
>[ $ edit COMMIT_N  ]
>  $ git hash-object -t commit -w COMMIT_N
Thanks for this tip, Jakub.

Christian, one thing that worries me is that 'git cat-file commit foo' returns the replacement (bar) instead of the original (foo). Is it intended? There is no way to retrieve the original commit using plumbing unless the replacement is removed. Am I right?

-- Hannes
Previous: Jakub NarebskiNext: Christian Couder
Message 9 of 12 in “combine git repo historically”
  1. bill lamOct 9, 2009
  2. Johannes SixtOct 9, 2009
  3. Christian CouderOct 9, 2009
  4. bill lamOct 10, 2009
  5. Christian CouderOct 11, 2009
  6. bill lamOct 11, 2009
  7. Christian CouderOct 11, 2009
  8. Jakub NarebskiOct 11, 2009
  9. Johannes SixtOct 11, 2009
  10. Christian CouderOct 11, 2009
  11. Jakub NarebskiOct 11, 2009
  12. Andreas SchwabOct 11, 2009

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.