{"thread":{"id":"205","subject":"\"checkout-cache\" update","startedAt":"2005-04-21T17:40:31Z","lastAt":"2005-04-21T17:40:31Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"1151","messageId":"Pine.LNX.4.58.0504211027500.2344@ppc970.osdl.org","threadId":"205","inReplyTo":null,"subject":"\"checkout-cache\" update","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-21T17:40:31Z","receivedAt":"2005-04-21T17:40:31Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nI just pushed out this very useful thing to \"checkout-cache\", which is \nbest just described by its commit log:\n\n  Add the ability to prefix something to the pathname to \"checkout-cache.c\"\n  \n  This basically makes it trivial to use checkout-cache as a \"export as\n  tree\" function. Just read the desired tree into the index, and do a\n  \n        checkout-cache --prefix=export-dir/ -a\n  \n  and checkout-cache will \"export\" the cache into the specified directory.\n  \n  NOTE! The final \"/\" is important. The exported name is literally just\n  prefixed with the specified string, so you can also do something like\n  \n        checkout-cache --prefix=.merged- Makefile\n  \n  to check out the currently cached copy of \"Makefile\" into the file\n  \".merged-Makefile\".\n\nBasically, I can do a a \"git-0.6\" release with a simple\n\n\tcheckout-cache --prefix=../git-0.6/ -a\n\nwhich basically says: check out all files, but use the prefix \n\"../git-0.6/\" before the filename when you do so.\n\nThen I just do\n\n\tcd ..\n\ttar czvf git-0.6.tar.gz git-0.6\n\nand I'm done. Very cool, very simple, and _extremely_ fast.\n\nDoing the tree export (not the tar) for the whole kernel takes two minutes\nin the cold-cache case (not so wonderful, but acceptable), and 4.6\n_seconds_ in the hot-cache case (pretty damn impressive, I say).\n\n(The compressng tar then takes about 20 seconds for me, and that's\nobviously all from the cache, since I just wrote it out).\n\nNOTE! The fact that the '/' at the end of the --prefix= thing is \nmeaningful can be very confusing, I freely admit. But it does end up being \npotentially quite useful, and you're likely to script usage of this anyway \ninto \"git export\" or something, so...\n\n\t\tLinus\n"}]}