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

Re: Joining Repositories

From
Petr Baudis <pasky@suse.cz>
Date
Jan 18, 2006, 12:58 UTC
Message-ID
<20060118125857.GO28365@pasky.or.cz>
In-Reply-To
<20060118125158.GN28365@pasky.or.cz>

Dear diary, on Wed, Jan 18, 2006 at 01:51:58PM CET, I got a letter where Petr Baudis <pasky@suse.cz> said that...

Show 7 quoted lines
>   But if you want r1/a, r2/b to turn to r/r1/a, r/r2/b, you will have
> to rewrite the history of each (and then do the above). One rough
> and untested sketch...
> 
> 	mkdir r1-rewritten
> 	cd r1-rewritten
> 	cp -a ../r1/.git .
	mkdir commitmap
Show 8 quoted lines
> 	for commit in $(git-rev-list --topo-order HEAD | tac); do
> 		git-read-tree --prefix=r1/ $commit
> 		# here, setup the AUTHOR/COMMITTER variables
> 		# appropriately (you can look at cg-commit's
> 		# $copy_commit handler)
> 		git-cat-file commit "$commit" | sed -e '1,/^$/d' | \
> 			git-commit-tree $(git-write-tree) \
> 				$(for parent in $(cg-object-id -p $commit); do
					echo -p
Show 5 quoted lines
> 					cat commitmap/$parent
> 				  done) >commitmap/$commit
> 		last_commit=$commit
> 	done
> 	git-update-ref HEAD $(cat commitmap/$last_commit)
	rm -rf commitmap
	cg-reset
  And at this point, git-prune will have plenty of work to do (many of
your tree and commit objects will be outdated - you just rewrote them).
  It's quite beautiful that you can do this all without checkouting a
single thing - you just load the tree to the index, prepend "r1/" to all
the paths, and commit it back.
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams
Previous: Petr BaudisNext: Mathias Waack
Message 3 of 25 in “Joining Repositories”
  1. Mathias WaackJan 18, 2006
  2. Petr BaudisJan 18, 2006
  3. Petr BaudisJan 18, 2006
  4. Mathias WaackJan 18, 2006
  5. Petr BaudisJan 18, 2006
  6. Mathias WaackJan 19, 2006
  7. Junio C HamanoJan 19, 2006
  8. Andreas EricssonJan 18, 2006
  9. Ryan AndersonJan 18, 2006
  10. Petr BaudisJan 18, 2006
  11. Ryan AndersonJan 18, 2006
  12. Linus TorvaldsJan 18, 2006
  13. Petr BaudisJan 18, 2006
  14. Junio C HamanoJan 18, 2006
  15. Linus TorvaldsJan 18, 2006
  16. Junio C HamanoJan 18, 2006
  17. Linus TorvaldsJan 18, 2006
  18. Junio C HamanoJan 18, 2006
  19. Linus TorvaldsJan 18, 2006
  20. Linus TorvaldsJan 18, 2006
  21. Linus TorvaldsJan 18, 2006
  22. Junio C HamanoJan 19, 2006
  23. Petr BaudisJan 19, 2006
  24. Ryan AndersonJan 18, 2006
  25. H. Peter AnvinJan 18, 2006

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.