{"thread":{"id":"33752","subject":"`git prune` doc or implementation defect, or user misunderstanding","startedAt":"2013-05-08T14:19:45Z","lastAt":"2013-05-08T16:05:28Z","messageCount":3,"participants":["Matt McClure","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"216708","messageId":"CAJELnLFpOT=V4f-pthDHkGqVWR7zSS=QYgMz35LWTUB9KvKNUQ@mail.gmail.com","threadId":"33752","inReplyTo":"CAJELnLF_oFcoqhRmzWwFne=8D5kwt8izk5fCDqmxPrROnOxh8g@mail.gmail.com","subject":"`git prune` doc or implementation defect, or user misunderstanding","fromName":"Matt McClure","fromEmail":"matthewlmcclure@gmail.com","sentAt":"2013-05-08T14:19:45Z","receivedAt":"2013-05-08T14:19:45Z","isPatch":false,"sender":{"key":"matthewlmcclure@gmail.com","avatar":"https://gravatar.com/avatar/a8cde96b0594204c8d4c48baa51c983af37dedfa2b7a846e27547b8d63d46e7c?d=mp&s=160"},"body":"The `git prune` documentation says:\n\n       This runs git fsck --unreachable using all the refs\n       available in refs/, optionally with additional set of\n       objects specified on the command line, and prunes all\n       unpacked objects unreachable from any of these head\n       objects from the object database. In addition, it prunes\n       the unpacked objects that are also found in packs by\n       running git prune-packed.\n\n       Note that unreachable, packed objects will remain. If this\n       is not desired, see git-repack(1).\n\nMy interpretation of that is that `git prune` will not prune packed objects\nby default. The following behavior seems inconsistent with that\ninterpretation.\n\n[git@438587-beefcake01 panama.git]$ git prune -n | wc -l\n9210\n[git@438587-beefcake01 panama.git]$ git fsck --unreachable | wc -l\n9468\n[git@438587-beefcake01 panama.git]$ git gc --no-prune\nCounting objects: 531223, done.\nDelta compression using up to 24 threads.\nCompressing objects: 100% (109848/109848), done.\nWriting objects: 100% (531223/531223), done.\nTotal 531223 (delta 405288), reused 530894 (delta 404961)\n[git@438587-beefcake01 panama.git]$ git prune -n | wc -l\n9468\n[git@438587-beefcake01 panama.git]$ git fsck --unreachable | wc -l\n9468\n\nIt looks like `git prune -n` is telling me that it would prune the objects\nthat I just packed. What am I misunderstanding?\n\n--\nMatt McClure\nhttp://matthewlmcclure.com\nhttp://www.mapmyfitness.com/profile/matthewlmcclure\n"},{"id":"216710","messageId":"518A6434.20300@viscovery.net","threadId":"33752","inReplyTo":"CAJELnLFpOT=V4f-pthDHkGqVWR7zSS=QYgMz35LWTUB9KvKNUQ@mail.gmail.com","subject":"Re: `git prune` doc or implementation defect, or user misunderstanding","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2013-05-08T14:41:56Z","receivedAt":"2013-05-08T14:41:56Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/8/2013 16:19, schrieb Matt McClure:\n> My interpretation of that is that `git prune` will not prune packed objects\n> by default. The following behavior seems inconsistent with that\n> interpretation.\n> \n> [git@438587-beefcake01 panama.git]$ git prune -n | wc -l\n> 9210\n\nYou have 9210 unreachable, loose objects.\n\n> [git@438587-beefcake01 panama.git]$ git fsck --unreachable | wc -l\n> 9468\n\nYou have 9468 unreachable objects in total.\n\n> [git@438587-beefcake01 panama.git]$ git gc --no-prune\n> Counting objects: 531223, done.\n> Delta compression using up to 24 threads.\n> Compressing objects: 100% (109848/109848), done.\n> Writing objects: 100% (531223/531223), done.\n> Total 531223 (delta 405288), reused 530894 (delta 404961)\n\nOnly reachable objects go into the new pack. Unreachable objects that were\nin the pack before, are evicted and are now loose.\n\n> [git@438587-beefcake01 panama.git]$ git prune -n | wc -l\n> 9468\n> [git@438587-beefcake01 panama.git]$ git fsck --unreachable | wc -l\n> 9468\n\nNow all 9468 unreachable objects are loose and eligible for being pruned.\n\n> It looks like `git prune -n` is telling me that it would prune the objects\n> that I just packed. What am I misunderstanding?\n\ngit gc moves unreachable objects that were packed before to the loose\nobject store, from where they can be pruned.\n\n-- Hannes\n"},{"id":"216714","messageId":"CAJELnLHjOUj8EO7RYqK9_9q=9Xa=B4HrZDCUd-JvMXOxTm6G3g@mail.gmail.com","threadId":"33752","inReplyTo":"518A6434.20300@viscovery.net","subject":"Re: `git prune` doc or implementation defect, or user misunderstanding","fromName":"Matt McClure","fromEmail":"matthewlmcclure@gmail.com","sentAt":"2013-05-08T16:05:28Z","receivedAt":"2013-05-08T16:05:28Z","isPatch":false,"sender":{"key":"matthewlmcclure@gmail.com","avatar":"https://gravatar.com/avatar/a8cde96b0594204c8d4c48baa51c983af37dedfa2b7a846e27547b8d63d46e7c?d=mp&s=160"},"body":"On Wed, May 8, 2013 at 10:41 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> git gc moves unreachable objects that were packed before to the loose\n> object store, from where they can be pruned.\n\nThanks. That was the piece I was missing. I assumed `git gc` did the opposite.\n\n-- \nMatt McClure\nhttp://matthewlmcclure.com\nhttp://www.mapmyfitness.com/profile/matthewlmcclure\n"}]}