{"thread":{"id":"3830","subject":"Funny repack behaviour","startedAt":"2006-04-08T10:41:15Z","lastAt":"2006-04-08T22:11:35Z","messageCount":3,"participants":["Johannes Schindelin","Nicolas Pitre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18465","messageId":"Pine.LNX.4.63.0604081233170.3283@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3830","inReplyTo":null,"subject":"Funny repack behaviour","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-04-08T10:41:15Z","receivedAt":"2006-04-08T10:41:15Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nI just accidentally reran \"git-repack -a -d\" on a repository, where I just \nhad run it. And I noticed a funny thing: Of about 4000 objects, it reused \nall but 8. So I reran it, and it reused all but 2. I ran it once again, \nand it reused all.\n\nThe really funny thing is: it created the same pack every time!\n\nIt is not critical, evidently, but I'd like to know what is causing this \nrather undeterministic behaviour. (Before you ask: no, I did not make a \nbackup before running the tests, so I unfortunately cannot reproduce it).\n\nCiao,\nDscho\n\nP.S.: This is the output:\n\n$ git-repack -a -d\nGenerating pack...\nDone counting 4259 objects.\nDeltifying 4259 objects.\n 100% (4259/4259) done\nWriting 4259 objects.\n 100% (4259/4259) done\nTotal 4259, written 4259 (delta 3391), reused 4241 (delta 3379)\nPack pack-66bd976bbdc2ac6da623b8af02037218ecd72ef0 created.\n$ git-repack -a -d\nGenerating pack...\nDone counting 4259 objects.\nDeltifying 4259 objects.\n 100% (4259/4259) done\nWriting 4259 objects.\n 100% (4259/4259) done\nTotal 4259, written 4259 (delta 3393), reused 4257 (delta 3391)\nPack pack-66bd976bbdc2ac6da623b8af02037218ecd72ef0 created.\n$ git-repack -a -d\nGenerating pack...\nDone counting 4259 objects.\nDeltifying 4259 objects.\n 100% (4259/4259) done\nWriting 4259 objects.\n 100% (4259/4259) done\nTotal 4259, written 4259 (delta 3393), reused 4259 (delta 3393)\nPack pack-66bd976bbdc2ac6da623b8af02037218ecd72ef0 created.\n"},{"id":"18473","messageId":"Pine.LNX.4.64.0604081528070.2215@localhost.localdomain","threadId":"3830","inReplyTo":"Pine.LNX.4.63.0604081233170.3283@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Funny repack behaviour","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-04-08T19:44:31Z","receivedAt":"2006-04-08T19:44:31Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Sat, 8 Apr 2006, Johannes Schindelin wrote:\n\n> Hi,\n> \n> I just accidentally reran \"git-repack -a -d\" on a repository, where I just \n> had run it. And I noticed a funny thing: Of about 4000 objects, it reused \n> all but 8. So I reran it, and it reused all but 2. I ran it once again, \n> and it reused all.\n> \n> The really funny thing is: it created the same pack every time!\n\nProbably not.  Subsequent packs were most probably even smaller !\n\n> It is not critical, evidently, but I'd like to know what is causing this \n> rather undeterministic behaviour. (Before you ask: no, I did not make a \n> backup before running the tests, so I unfortunately cannot reproduce it).\n\nTo reproduce, or rather to reset the pack state, just use\n\"git-repack -a -f -d\" then  \"git-repack -a -d\" multiple times again.\n\nFor example, on the current git archive:\n\n$ git-repack -a -f -d\n[...]\nTotal 16548, written 16548 (delta 11007), reused 5390 (delta 0)\nPack pack-af9d39abfcb5fd6fd554f7fc8d1704f8dd2329e0 created.\n\npack size = 6032083 bytes.\n\n$ git-repack -a -d\n[...]\nTotal 16548, written 16548 (delta 11030), reused 16525 (delta 11007)\nPack pack-af9d39abfcb5fd6fd554f7fc8d1704f8dd2329e0 created.\n\npack size = 5976610 bytes\n\n$ git-repack -a -d\n[...]\nTotal 16548, written 16548 (delta 11030), reused 16548 (delta 11030)\nPack pack-af9d39abfcb5fd6fd554f7fc8d1704f8dd2329e0 created.\n\nPack size =  5976610 bytes\n\nSo in this case it took 2 itterations before converging on a smaller \npack by 55473 bytes.\n\nI thought the reuse logic might sacrifice a bit on compression given the \nspeed boost, but I don't get why it is the opposite in practice and that \n-f doesn't produce the smallest pack up front.\n\n\nNicolas\n"},{"id":"18485","messageId":"Pine.LNX.4.63.0604090010120.9176@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3830","inReplyTo":"Pine.LNX.4.64.0604081528070.2215@localhost.localdomain","subject":"Re: Funny repack behaviour","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-04-08T22:11:35Z","receivedAt":"2006-04-08T22:11:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 8 Apr 2006, Nicolas Pitre wrote:\n\n> On Sat, 8 Apr 2006, Johannes Schindelin wrote:\n> \n> > Hi,\n> > \n> > I just accidentally reran \"git-repack -a -d\" on a repository, where I just \n> > had run it. And I noticed a funny thing: Of about 4000 objects, it reused \n> > all but 8. So I reran it, and it reused all but 2. I ran it once again, \n> > and it reused all.\n> > \n> > The really funny thing is: it created the same pack every time!\n> \n> Probably not.  Subsequent packs were most probably even smaller !\n\nOh, you're right. I was tricked by the identical pack-names. Somehow I \nforgot that the pack name just reflects a hash of the _unpacked_ objects, \nnot the pack file itself.\n\nSorry for the noise.\n\nCiao,\nDscho\n"}]}