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

Re: Creating objects manually and repack

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 4, 2006, 05:01 UTC
Message-ID
<Pine.LNX.4.64.0608032150510.4168@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0608032138330.4168@g5.osdl.org>
On Thu, 3 Aug 2006, Linus Torvalds wrote:
> 
> Sure. In that case, just list the object ID's in the exact same order you 
> created them.

Btw, you still want to give a filename for each object you've created, so that the delta sorter does the right thing for the packing. It doesn't have to be a _real_ filename - just make sure that each revision that comes from the same file has a filename that matches all the other revisions from that file.

What the filename actually _is_ doesn't much matter, and it doesn't have to be the "real" filename that was associated with that set of revisions, since we'll just end up hashing it anyway. So it could be some "SVN inode number" for that set of revisions or something, for all git-pack-object cares.

So you could just go through each SVN file in whatever the SVN database is (I don't know how SVN organizes it), generate every revisions for that file, and pass in the SVN _database_ filename, rather than necessarily the filename that that revision is actually associated with when checked out.

So for example, if SVN were to use the same kind of "Attic/filename,v" format that CVS uses, there's no reason to worry what the real filename was in any particular checked out tree, you could just pass git-pack-objects a series of lines in the form of

	..
	<sha1-object-name-of-rev1> Attic/filename,v
	<sha1-object-name-of-rev2> Attic/filename,v
	<sha1-object-name-of-rev3> Attic/filename,v
	..

as input on its stdin, and it will create a pack-file of all the objects you name, and use the "Attic/filename,v" info as the deltifier hint to know to do all the deltas of those revs against each other rather than against random other objects.

The fact that the file was actually checked out as "src/filename" (and, since SVN supports renaming, it might have been checked out under any number of _other_ names over the history of the project) doesn't matter, and you don't need to even try to figure that out. git-pack-objects wouldn't care anyway.

			Linus
Previous: Linus TorvaldsNext: Jon Smirl
Message 6 of 36 in “Creating objects manually and repack”
  1. Jon SmirlAug 4, 2006
  2. Jeff KingAug 4, 2006
  3. Linus TorvaldsAug 4, 2006
  4. Jon SmirlAug 4, 2006
  5. Linus TorvaldsAug 4, 2006
  6. Linus TorvaldsAug 4, 2006
  7. Jon SmirlAug 4, 2006
  8. Jon SmirlAug 4, 2006
  9. Jon SmirlAug 4, 2006
  10. Linus TorvaldsAug 4, 2006
  11. Jon SmirlAug 4, 2006
  12. A Large Angry SCMAug 4, 2006
  13. Jon SmirlAug 4, 2006
  14. Linus TorvaldsAug 4, 2006
  15. Linus TorvaldsAug 4, 2006
  16. Rogan DawesAug 4, 2006
  17. Jon SmirlAug 4, 2006
  18. Linus TorvaldsAug 4, 2006
  19. Jon SmirlAug 4, 2006
  20. Linus TorvaldsAug 4, 2006
  21. Linus TorvaldsAug 4, 2006
  22. Junio C HamanoAug 4, 2006
  23. Linus TorvaldsAug 4, 2006
  24. Carl WorthAug 4, 2006
  25. Junio C HamanoAug 4, 2006
  26. Carl WorthAug 4, 2006
  27. Carl WorthAug 4, 2006
  28. Jakub NarebskiAug 4, 2006
  29. Junio C HamanoAug 4, 2006
  30. Jakub NarebskiAug 4, 2006
  31. Martin LanghoffAug 5, 2006
  32. Jon SmirlAug 5, 2006
  33. Shawn PearceAug 5, 2006
  34. Jon SmirlAug 5, 2006
  35. Shawn PearceAug 5, 2006
  36. Shawn PearceAug 5, 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.