{"thread":{"id":"139","subject":"naive question","startedAt":"2005-04-19T13:00:14Z","lastAt":"2005-04-19T18:27:34Z","messageCount":6,"participants":["Paul Mackerras","David Woodhouse","Ingo Molnar","Petr Baudis","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"817","messageId":"16997.222.917219.386956@cargo.ozlabs.ibm.com","threadId":"139","inReplyTo":null,"subject":"naive question","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2005-04-19T13:00:14Z","receivedAt":"2005-04-19T13:00:14Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Is there a way to check out a tree without changing the mtime of any\nfiles that you have already checked out and which are the same as the\nversion you are checking out?  It seems that checkout-cache -a doesn't\noverwrite any existing files, and checkout-cache -f -a overwrites all\nfiles and gives them the current mtime.  This is a pain if you are\nusing make and your tree is large (like, for instance, the linux\nkernel :), because it means that after a checkout-cache -f -a you get\nto recompile everything.\n\nPaul.\n"},{"id":"818","messageId":"1113916741.4166.0.camel@localhost.localdomain","threadId":"139","inReplyTo":"16997.222.917219.386956@cargo.ozlabs.ibm.com","subject":"Re: naive question","fromName":"David Woodhouse","fromEmail":"dwmw2@infradead.org","sentAt":"2005-04-19T13:19:00Z","receivedAt":"2005-04-19T13:19:00Z","isPatch":false,"sender":{"key":"dwmw2@infradead.org","avatar":"https://gravatar.com/avatar/7afd4f07e0cf7d7e046ae2d23678296b37777c96488e6f3451e78a5514154ebd?d=mp&s=160"},"body":"On Tue, 2005-04-19 at 23:00 +1000, Paul Mackerras wrote:\n> Is there a way to check out a tree without changing the mtime of any\n> files that you have already checked out and which are the same as the\n> version you are checking out?  It seems that checkout-cache -a doesn't\n> overwrite any existing files, and checkout-cache -f -a overwrites all\n> files and gives them the current mtime.  This is a pain if you are\n> using make and your tree is large (like, for instance, the linux\n> kernel :), because it means that after a checkout-cache -f -a you get\n> to recompile everything.\n\nCorollary: why aren't we storing mtime in the tree objects?\n\n-- \ndwmw2\n\n"},{"id":"820","messageId":"20050419135153.GB19146@elte.hu","threadId":"139","inReplyTo":"1113916741.4166.0.camel@localhost.localdomain","subject":"Re: naive question","fromName":"Ingo Molnar","fromEmail":"mingo@elte.hu","sentAt":"2005-04-19T13:51:53Z","receivedAt":"2005-04-19T13:51:53Z","isPatch":false,"sender":{"key":"mingo@elte.hu","avatar":null},"body":"\n* David Woodhouse <dwmw2@infradead.org> wrote:\n\n> On Tue, 2005-04-19 at 23:00 +1000, Paul Mackerras wrote:\n> > Is there a way to check out a tree without changing the mtime of any\n> > files that you have already checked out and which are the same as the\n> > version you are checking out?  It seems that checkout-cache -a doesn't\n> > overwrite any existing files, and checkout-cache -f -a overwrites all\n> > files and gives them the current mtime.  This is a pain if you are\n> > using make and your tree is large (like, for instance, the linux\n> > kernel :), because it means that after a checkout-cache -f -a you get\n> > to recompile everything.\n> \n> Corollary: why aren't we storing mtime in the tree objects?\n\nCheck the \"[bug] git: check-files mtime problem?\" thread - i noticed \nthis problem before and gave a few suggestions but the discussion got \nnowhere. But the problem is still very much present.\n\n\tIngo\n"},{"id":"837","messageId":"20050419171534.GH12757@pasky.ji.cz","threadId":"139","inReplyTo":"16997.222.917219.386956@cargo.ozlabs.ibm.com","subject":"Re: naive question","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-19T17:15:34Z","receivedAt":"2005-04-19T17:15:34Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Apr 19, 2005 at 03:00:14PM CEST, I got a letter\nwhere Paul Mackerras <paulus@samba.org> told me that...\n> Is there a way to check out a tree without changing the mtime of any\n> files that you have already checked out and which are the same as the\n> version you are checking out?  It seems that checkout-cache -a doesn't\n> overwrite any existing files, and checkout-cache -f -a overwrites all\n> files and gives them the current mtime.  This is a pain if you are\n> using make and your tree is large (like, for instance, the linux\n> kernel :), because it means that after a checkout-cache -f -a you get\n> to recompile everything.\n\nActually, to then get sensible show-diff output, you need to also\nupdate-cache --refresh to compensate for the changes. I personally\nreally hate update-cache --refresh; sure, 0.1s with hot cache, but\neasily eats 5 minutes (!) with cold cache.\n\nI'd actually prefer, if:\n\n(i) checkout-cache simply wouldn't touch files whose stat matches with\nwhat is in the cache; it updates the cache with the stat informations\nof touched files\n\n(ii) read-tree would take over the stat information from the matching\nfiles in previous cache.\n\nThis way, doing update-cache --refresh would become a rather rare event.\nStuff would become swifter, faster, less I/O bound and you would get rid\nof problems as the one described above.\n\nWhat do you think?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"844","messageId":"Pine.LNX.4.58.0504191036560.19286@ppc970.osdl.org","threadId":"139","inReplyTo":"20050419171534.GH12757@pasky.ji.cz","subject":"Re: naive question","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-19T17:41:19Z","receivedAt":"2005-04-19T17:41:19Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 19 Apr 2005, Petr Baudis wrote:\n> \n> I'd actually prefer, if:\n> \n> (i) checkout-cache simply wouldn't touch files whose stat matches with\n> what is in the cache; it updates the cache with the stat informations\n> of touched files\n\nRun \"update-cache --refresh\" _before_ doing the \"checkout-cache\", and that \nis exactly what will happen.\n\nBut yes, if you want to make checkout-cache update the stat info (Ingo \nwanted to do that too), it should be possible. The end result is a \ncombination of \"update-cache\" and \"checkout-cache\", though: you'll \neffectively need to both (just in one pass).\n\nWith the current setup, you have to do\n\n\tupdate-cache --refresh\n\tcheckout-cache -f -a\n\tupdate-cache --refresh\n\nwhich is admittedly fairly inefficient.\n\nThe real expense right now of a merge is that we always forget all the\nstat information when we do a merge (since it does a read-tree). I have a\ncunning way to fix that, though, which is to make \"read-tree -m\" read in\nthe old index state like it used to, and then at the end just throw it\naway except for the stat information.\n\n\t\tLinus\n"},{"id":"849","messageId":"Pine.LNX.4.58.0504191117570.19286@ppc970.osdl.org","threadId":"139","inReplyTo":"Pine.LNX.4.58.0504191036560.19286@ppc970.osdl.org","subject":"Re: naive question","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-19T18:27:34Z","receivedAt":"2005-04-19T18:27:34Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 19 Apr 2005, Linus Torvalds wrote:\n> \n> The real expense right now of a merge is that we always forget all the\n> stat information when we do a merge (since it does a read-tree). I have a\n> cunning way to fix that, though, which is to make \"read-tree -m\" read in\n> the old index state like it used to, and then at the end just throw it\n> away except for the stat information.\n\nOk, done. That was really the plan all along, it just got dropped in the \nexcitement of trying to get the dang thing to _work_ in the first place ;)\n\nThe current version only does\n\n\tread-tree -m <orig> <branch1> <branch2>\n\nwhich now reads the old stat cache information, and then applies that to \nthe end result of any trivial merges in case the merge result matches the \nold file stats. It really boils down to this littel gem;\n\n            /*\n             * See if we can re-use the old CE directly?\n             * That way we get the uptodate stat info.\n             */\n            if (path_matches(result, old) && same(result, old))\n                    *result = *old;\n\n\nand it seems to work fine.\n\nHOWEVER, I'll also make it do the same for a \"single-tree merge\":\n\n\tread-tree -m <newtree>\n\nso that you can basically say \"read a new tree, and merge the stat \ninformation from the current cache\".  That means that if you do a\n\"read-tree -m <newtree>\" followed by a \"checkout-cache -f -a\", the \ncheckout-cache only checks out the stuff that really changed.\n\nYou'll still need to do an \"update-cache --refresh\" for the actual new\nstuff. We could make \"checkout-cache\" update the cache too, but I really\ndo prefer a \"checkout-cache only reads the index, never changes it\"  \nworld-view. It's nice to be able to have a read-only git tree.\n\nFinal note: just doing a plain \"read-tree <newtree>\" will still throw all\nthe stat info away, and you'll have to refresh it all...\n\n\t\tLinus\n"}]}