threads / discuss / 205

"checkout-cache" update

Subject: "checkout-cache" update

## tl;dr

One message between Apr 21, 2005 and Apr 21, 2005.

replies: 0people: 1as markdown or json

Linus Torvalds· Apr 21, 2005, 17:40 UTC · lore

I just pushed out this very useful thing to "checkout-cache", which is best just described by its commit log:

  Add the ability to prefix something to the pathname to "checkout-cache.c"
  
  This basically makes it trivial to use checkout-cache as a "export as
  tree" function. Just read the desired tree into the index, and do a
  
        checkout-cache --prefix=export-dir/ -a
  
  and checkout-cache will "export" the cache into the specified directory.
  
  NOTE! The final "/" is important. The exported name is literally just
  prefixed with the specified string, so you can also do something like
  
        checkout-cache --prefix=.merged- Makefile
  
  to check out the currently cached copy of "Makefile" into the file
  ".merged-Makefile".
Basically, I can do a a "git-0.6" release with a simple
	checkout-cache --prefix=../git-0.6/ -a

which basically says: check out all files, but use the prefix "../git-0.6/" before the filename when you do so.

Then I just do
	cd ..
	tar czvf git-0.6.tar.gz git-0.6
and I'm done. Very cool, very simple, and _extremely_ fast.

Doing the tree export (not the tar) for the whole kernel takes two minutes in the cold-cache case (not so wonderful, but acceptable), and 4.6 _seconds_ in the hot-cache case (pretty damn impressive, I say).

(The compressng tar then takes about 20 seconds for me, and that's obviously all from the cache, since I just wrote it out).

NOTE! The fact that the '/' at the end of the --prefix= thing is meaningful can be very confusing, I freely admit. But it does end up being potentially quite useful, and you're likely to script usage of this anyway into "git export" or something, so...

		Linus

← back to recent threads