Re: Creating objects manually and repack
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Aug 4, 2006, 04:01 UTC
- Message-ID
- <Pine.LNX.4.64.0608032052210.4168@g5.osdl.org>
- In-Reply-To
- <9e4733910608032043u689f431rc5408c6d89398142@mail.gmail.com>
On Thu, 3 Aug 2006, Jon Smirl wrote:
Show 5 quoted lines
> > I've made 500K object files with my cvs2svn front end. This is 500K of > revision files and no tree files. Now I run get-repack. It says done > counting zero objects. What needs to be update so that repack will > find all of my objects?
Just enumerate them by hand, and pass the list off to git-pack-objects.
IOW, you can _literally_ do something like this
(cd .git/objects ; find . -type f -name '[0-9a-f]*' | tr -d '\./') | git-pack-objects tmp-pack
and it will generate a pack-file and index (called "tmp-pack-*.pack" and "tmp-pack-*.idx" respectively) that contains all your lose objects.
Now, that said, pack-file will generally _suck_ if you actually do it like the above. You actually want to pass in the object names _together_ with the filenames they were generated from, so that git-pack-objects can use its heuristics for finding good delta candidates.
So what you actually want to do is pass in a set of object names with the name of the file they came with (space in between). See for example
git-rev-list --objects HEAD^..
output for how something like that might look (git-pack-objects is designed to take the "git-rev-list --objects" output as its input).
> git-fsck isn't happy either since I have no HEAD.
Yeah, you cannot (and mustn't) run anything like git-fsck-objects or "git prune" until you've connected them all up somehow.
Linus