{"thread":{"id":"26589","subject":"Git pack - repo size doubled","startedAt":"2011-02-24T08:19:06Z","lastAt":"2011-02-24T10:02:34Z","messageCount":3,"participants":["Maaartin","Jeff King","Maaartin-1"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162112","messageId":"ik549p$pq8$1@dough.gmane.org","threadId":"26589","inReplyTo":null,"subject":"Git pack - repo size doubled","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2011-02-24T08:19:06Z","receivedAt":"2011-02-24T08:19:06Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"I'm using git version 1.7.3.3 under cygwin (W XP64). When I tried\n\ngit repack -A -d --depth=255 --window=255 --window-memory=4g\n\nI've got the message\n\nrm: cannot remove `pack-c75642be5314b1a98ddfcf0d51ac838db4af75ad.pack':\nDevice or resource busy\n\nIt seems like the file hadn't got closed. The non-deletion of the file\nroughly doubles the repo size (134070 KiB instead of 67470 KiB).\n\n- Can I manually remove the file?\n\n- If I do it, does \"git fsck\" suffice to make sure, everything's all right?\n\n- Would creating of multiple packs work better? What \"--max-pack-size\"\nwould you recommend?\n"},{"id":"162114","messageId":"20110224083138.GA26439@sigill.intra.peff.net","threadId":"26589","inReplyTo":"ik549p$pq8$1@dough.gmane.org","subject":"Re: Git pack - repo size doubled","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-24T08:31:38Z","receivedAt":"2011-02-24T08:31:38Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 24, 2011 at 09:19:06AM +0100, Maaartin wrote:\n\n> I'm using git version 1.7.3.3 under cygwin (W XP64). When I tried\n> \n> git repack -A -d --depth=255 --window=255 --window-memory=4g\n> \n> I've got the message\n> \n> rm: cannot remove `pack-c75642be5314b1a98ddfcf0d51ac838db4af75ad.pack':\n> Device or resource busy\n\nPresumably some git process still has the pack open, and Windows can't\ndelete open files. The process which removes the old pack is different\nfrom the one that creates the new pack, so there shouldn't be conflict\nthere. Were you running any other git programs at the time?\n\n> It seems like the file hadn't got closed. The non-deletion of the file\n> roughly doubles the repo size (134070 KiB instead of 67470 KiB).\n> \n> - Can I manually remove the file?\n\nProbably. Move it (and its associated .idx file) out of the pack\ndirectory, and then run \"git fsck\" to make sure all is well.\n\n> - If I do it, does \"git fsck\" suffice to make sure, everything's all right?\n\nAs a general rule, almost certainly, but there is one corner case. \"git\nfsck\" will proceed from your refs and reflogs and check that nothing is\nmissing.\n\nBut it's possible that you had unreferenced objects in the old pack\nwhich will now be lost. In practice, this doesn't really matter much.\nDue to reflogs, things don't tend to be unreferenced. And even if they\nare, they are probably worthless old cruft that was expired from the\nreflog.\n\nIn your case, it is even more certain. Since you used \"-A\", unreachable\nobjects in the original pack were exploded into loose objects. So\nassuming that process worked correctly, then everything in that pack is\nduplicated.\n\n> - Would creating of multiple packs work better? What \"--max-pack-size\"\n> would you recommend?\n\nIt shouldn't make a difference. This is about removing the old pack; it\nshouldn't matter how many new packs you've made, unless there is some\nbug.\n\n-Peff\n"},{"id":"162122","messageId":"4D662CBA.4080709@seznam.cz","threadId":"26589","inReplyTo":"20110224083138.GA26439@sigill.intra.peff.net","subject":"Re: Git pack - repo size doubled","fromName":"Maaartin-1","fromEmail":"grajcar1@seznam.cz","sentAt":"2011-02-24T10:02:34Z","receivedAt":"2011-02-24T10:02:34Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"On 11-02-24 09:31, Jeff King wrote:\n> On Thu, Feb 24, 2011 at 09:19:06AM +0100, Maaartin wrote:\n> \n>> I'm using git version 1.7.3.3 under cygwin (W XP64). When I tried\n>>\n>> git repack -A -d --depth=255 --window=255 --window-memory=4g\n>>\n>> I've got the message\n>>\n>> rm: cannot remove `pack-c75642be5314b1a98ddfcf0d51ac838db4af75ad.pack':\n>> Device or resource busy\n> \n> Presumably some git process still has the pack open, and Windows can't\n> delete open files. The process which removes the old pack is different\n> from the one that creates the new pack, so there shouldn't be conflict\n> there. Were you running any other git programs at the time?\n\nI was sure I weren't, otherwise I wouldn't have posted this. The problem\nwas reproducible. But there was EGit, what I didn't thing about. It must\nhave been the culprit, now it works perfectly.\n\n>> It seems like the file hadn't got closed. The non-deletion of the file\n>> roughly doubles the repo size (134070 KiB instead of 67470 KiB).\n>>\n>> - Can I manually remove the file?\n> \n> Probably. Move it (and its associated .idx file) out of the pack\n> directory, and then run \"git fsck\" to make sure all is well.\n\nOK.\n\n>> - If I do it, does \"git fsck\" suffice to make sure, everything's all right?\n> \n> As a general rule, almost certainly, but there is one corner case. \"git\n> fsck\" will proceed from your refs and reflogs and check that nothing is\n> missing.\n> \n> But it's possible that you had unreferenced objects in the old pack\n> which will now be lost. In practice, this doesn't really matter much.\n> Due to reflogs, things don't tend to be unreferenced. And even if they\n> are, they are probably worthless old cruft that was expired from the\n> reflog.\n> \n> In your case, it is even more certain. Since you used \"-A\", unreachable\n> objects in the original pack were exploded into loose objects. So\n> assuming that process worked correctly, then everything in that pack is\n> duplicated.\n\nOK.\n\n>> - Would creating of multiple packs work better? What \"--max-pack-size\"\n>> would you recommend?\n> \n> It shouldn't make a difference. This is about removing the old pack; it\n> shouldn't matter how many new packs you've made, unless there is some\n> bug.\n\nThis was meant as a workaround: create more smaller packs, manually\ndelete the large one, so that in the future maybe only one smaller pack\nwould get undeleted. But it was my fault and no bug at all.\n\nThanks a lot.\n"}]}