{"thread":{"id":"7816","subject":".git grows after git-gc?","startedAt":"2007-04-24T13:31:32Z","lastAt":"2007-04-24T14:56:53Z","messageCount":4,"participants":["Andy Parkins","Nicolas Pitre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"40325","messageId":"200704241431.33624.andyparkins@gmail.com","threadId":"7816","inReplyTo":null,"subject":".git grows after git-gc?","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-04-24T13:31:32Z","receivedAt":"2007-04-24T13:31:32Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Hello,\n\nNot important at all, but I was surprised to see this:\n\n$ git fetch \\\n   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.16.y.git \\\n   refs/heads/master:refs/remotes/vendor\nremote: Generating pack...\nremote: Done counting 194409 objects.\nremote: Deltifying 194409 objects.\nremote:  100% (194409/194409) done\nIndexing 194409 objects.\nremote: Total 194409 (delta 147074), reused 179896 (delta 138737)\n 100% (194409/194409) done\nResolving 147074 deltas.\n 100% (147074/147074) done\n* refs/remotes/vendor: storing branch 'master' of \ngit://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.16.y\n  commit: 7a715c6\n\n$ du -h .git\n95M     .git\n\n$ git-gc --prune\nGenerating pack...\nDone counting 194520 objects.\nDeltifying 194520 objects...\n 100% (194520/194520) done\nWriting 194520 objects...\n 100% (194520/194520) done\nTotal 194520 (delta 147074), reused 194520 (delta 147074)\nPack pack-220cec9989ebd8b75963de71742861c6adbeda7d created.\nRemoving unused objects 100%...\nDone.\n\n$ du -h .git\n97M     .git\n\nThat's a bit odd isn't it?\n\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"40327","messageId":"alpine.LFD.0.98.0704240939360.12375@xanadu.home","threadId":"7816","inReplyTo":"200704241431.33624.andyparkins@gmail.com","subject":"Re: .git grows after git-gc?","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-04-24T14:00:59Z","receivedAt":"2007-04-24T14:00:59Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 24 Apr 2007, Andy Parkins wrote:\n\n> Hello,\n> \n> Not important at all, but I was surprised to see this:\n> \n> $ git fetch \\\n>    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.16.y.git \\\n>    refs/heads/master:refs/remotes/vendor\n> remote: Generating pack...\n[...]\n> $ du -h .git\n> 95M     .git\n> \n> $ git-gc --prune\n> Generating pack...\n[...]\n> $ du -h .git\n> 97M     .git\n> \n> That's a bit odd isn't it?\n\nTwo possible explanations:\n\n1) I recently fixed pack-objects which didn't respect the delta depth\n   limit when fetching. See commit  898b14cedc for details. This could \n   potentially cause some repacks to create slightly larger packs.\n\n2) When fetching a pack, the client sends its capabilities to the server \n   who can alter some packing parameters accordingly.  One such \n   parameter is --delta-base-offset which your client most certainly \n   supports.  This means that the packs you receive and keep as is in \n   your local repo were encoded with --delta-base-offset for maximum \n   network efficiency.\n\n   Now when you repack, this parameter won't be used by default unless \n   you have repack.usedeltabaseoffset set to true in your config, which \n   will cause a small increase in pack size.\n\nI think that (2) is the most probable cause of repack growth in your \ncase.  Just try:\n\n\tgit config --global repack.usedeltabaseoffset true\n\tgit gc\n\nand you should get that 2MB back, possibly a bit more.\n\n\nNicolas\n"},{"id":"40330","messageId":"200704241535.32623.andyparkins@gmail.com","threadId":"7816","inReplyTo":"alpine.LFD.0.98.0704240939360.12375@xanadu.home","subject":"Re: .git grows after git-gc?","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-04-24T14:35:30Z","receivedAt":"2007-04-24T14:35:30Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 April 24, Nicolas Pitre wrote:\n\nThank you for your thorough explanation.\n\n>    Now when you repack, this parameter won't be used by default unless\n>    you have repack.usedeltabaseoffset set to true in your config, which\n>    will cause a small increase in pack size.\n\nThat sounds like it could easily be it.  I thought I had usedeltabaseoffset \nturned on ages ago; but it turns out (while investigating this strange \nbehaviour) what I actually had turned on was \"usedelatabaseoffset\".\n\nDoh!\n\n> I think that (2) is the most probable cause of repack growth in your\n> case.  Just try:\n>\n> \tgit config --global repack.usedeltabaseoffset true\n> \tgit gc\n>\n> and you should get that 2MB back, possibly a bit more.\n\nStrangely enough - I didn't - stayed at 97MB.  It's probably (1) then.\n\nThanks for your time.  You've helped me find a typo in my config even if I \ndidn't get my 2MB back :-)\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"40333","messageId":"alpine.LFD.0.98.0704241051330.12375@xanadu.home","threadId":"7816","inReplyTo":"200704241535.32623.andyparkins@gmail.com","subject":"Re: .git grows after git-gc?","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-04-24T14:56:53Z","receivedAt":"2007-04-24T14:56:53Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 24 Apr 2007, Andy Parkins wrote:\n\n> > I think that (2) is the most probable cause of repack growth in your\n> > case.  Just try:\n> >\n> > \tgit config --global repack.usedeltabaseoffset true\n> > \tgit gc\n> >\n> > and you should get that 2MB back, possibly a bit more.\n> \n> Strangely enough - I didn't - stayed at 97MB.  It's probably (1) then.\n\nWell... to be sure, also try:\n\n\tgit config --global repack.usedeltabaseoffset false\n\tgit gc\n\nand verify that the repository actually grew.  If it stays the same then \nsomething is not right.\n\n\nNicolas\n"}]}