{"thread":{"id":"28192","subject":"Missing blobs after pruning dangling commits","startedAt":"2011-08-22T14:29:10Z","lastAt":"2011-08-23T10:16:49Z","messageCount":3,"participants":["Marcin Wiśnicki","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"174018","messageId":"CAC9GOO-cAKTvUyKvrijA8H8z4uRFkTjzJ_dqS_-aO1MYB-yaTw@mail.gmail.com","threadId":"28192","inReplyTo":null,"subject":"Missing blobs after pruning dangling commits","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-08-22T14:29:10Z","receivedAt":"2011-08-22T14:29:10Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"Hello,\n\nrecently I had git-fsck report some dangling references:\n\n$ git fsck\ndangling commit 9275ee571ead7a75ba57e16ba23155a178459918\ndangling commit 047bd63ae82b7540098515467f50562e374edada\ndangling commit 839cee3c8e16231e6523ecf8b855ef0863787990\ndangling commit f7cb119ea71cb3cc739331f2e26bf3e9fdbba24a\ndangling commit 68d41b28f320aff303c5a89b25e2243ad2e526f2\ndangling commit effcf50a636d2f08e21706f41eb8ae3c4c577166\n\nThis is completely local (isolated) repository.\nBased on related FAQ entry (\"remove old objects after filter-branch\"),\nI did this:\n\n$ git reflog expire --expire=0 --all\n$ git repack -ad\n$ git prune\n\nUnfortunately, now fsck complains:\n\n$ git fsck\nmissing blob 6d2ddd86d4594f8c756cc31b72d61653255a3161\nmissing blob 6c537408f0b2226c0b6dae9b0ef0f92710fb25ed\nmissing blob 2db55c1e39fd80e39eccefc617b852d3ac93abe9\n$ git --version\ngit version 1.7.6.msysgit.0\n\nIs this a bug ?\n\nAlso, how can I find where this blob came from. I've tried grepping\nall commits in original repo (from backup):\n\n$ gitwhich() {\n  git log --all --pretty=format:'%T %H' | while read tree commit; do\n    git ls-tree -r $tree | grep -q $1 && echo $commit;\n  done\n}\n$ gitwhich 2db55c1e39fd80e39eccefc617b852d3ac93abe9\n\nbut nothing was found.\n"},{"id":"174082","messageId":"4E5372E5.1070509@drmicha.warpmail.net","threadId":"28192","inReplyTo":"CAC9GOO-cAKTvUyKvrijA8H8z4uRFkTjzJ_dqS_-aO1MYB-yaTw@mail.gmail.com","subject":"Re: Missing blobs after pruning dangling commits","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-08-23T09:29:09Z","receivedAt":"2011-08-23T09:29:09Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Marcin Wiśnicki venit, vidit, dixit 22.08.2011 16:29:\n> Hello,\n> \n> recently I had git-fsck report some dangling references:\n> \n> $ git fsck\n> dangling commit 9275ee571ead7a75ba57e16ba23155a178459918\n> dangling commit 047bd63ae82b7540098515467f50562e374edada\n> dangling commit 839cee3c8e16231e6523ecf8b855ef0863787990\n> dangling commit f7cb119ea71cb3cc739331f2e26bf3e9fdbba24a\n> dangling commit 68d41b28f320aff303c5a89b25e2243ad2e526f2\n> dangling commit effcf50a636d2f08e21706f41eb8ae3c4c577166\n> \n> This is completely local (isolated) repository.\n> Based on related FAQ entry (\"remove old objects after filter-branch\"),\n> I did this:\n> \n> $ git reflog expire --expire=0 --all\n> $ git repack -ad\n> $ git prune\n> \n> Unfortunately, now fsck complains:\n> \n> $ git fsck\n> missing blob 6d2ddd86d4594f8c756cc31b72d61653255a3161\n> missing blob 6c537408f0b2226c0b6dae9b0ef0f92710fb25ed\n> missing blob 2db55c1e39fd80e39eccefc617b852d3ac93abe9\n> $ git --version\n> git version 1.7.6.msysgit.0\n> \n> Is this a bug ?\n> \n> Also, how can I find where this blob came from. I've tried grepping\n> all commits in original repo (from backup):\n> \n> $ gitwhich() {\n>   git log --all --pretty=format:'%T %H' | while read tree commit; do\n>     git ls-tree -r $tree | grep -q $1 && echo $commit;\n>   done\n> }\n> $ gitwhich 2db55c1e39fd80e39eccefc617b852d3ac93abe9\n> \n> but nothing was found.\n\nSuggestions:\n\nTry git fsck --unreachable.\nThere may be tree objects which reference those blobs but are not\nreferenced by a tree or commit. (They should have been pruned, but could\nhave been stuck in a pack.)\n\nTry repacking again after the prune step.\n\nCould you share that repo or is it private?\n\nMichael\n"},{"id":"174085","messageId":"CAC9GOO_QGsadeE4EK8gg6JMZdzFPY_SjnnwOqjp5f--A2SO9Og@mail.gmail.com","threadId":"28192","inReplyTo":"4E5372E5.1070509@drmicha.warpmail.net","subject":"Re: Missing blobs after pruning dangling commits","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-08-23T10:16:49Z","receivedAt":"2011-08-23T10:16:49Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"2011/8/23 Michael J Gruber <git@drmicha.warpmail.net>:\n> Suggestions:\n\nNeither of them helped, however I've added old packs from backup and did\n\ngit fsck\ngit repack -ad\ngit reflog expire --expire=0 --all\ngit repack -ad\ngit prune\ngit fsck\n\nAnd now everything is fine.\n\nOnly thing that concerns me is that there are still two packs:\n$ ls -la .git/objects/pack/\ntotal 145632\ndrwxr-xr-x    2 marcin.w Administ     4096 Aug 23 11:42 .\ndrwxr-xr-x    4 marcin.w Administ    20480 Aug 23 11:47 ..\n-rw-r--r--    1 marcin.w Administ   529152 Aug  9 15:01\n.tmp-3616-pack-83952e51abdea7469eef06dde2e692e04ba8f9f3.idx\n-rw-r--r--    1 marcin.w Administ 149572531 Aug  9 15:01\n.tmp-3616-pack-83952e51abdea7469eef06dde2e692e04ba8f9f3.pack\n-r--r--r--    1 marcin.w Administ   555724 Aug 23 11:42\npack-3cd1ec9be7cdb31d8eac4404c249edf9c1654937.idx\n-r--r--r--    1 marcin.w Administ 147570858 Aug 23 11:42\npack-3cd1ec9be7cdb31d8eac4404c249edf9c1654937.pack\n\nBoth files have identical ACLs but pack-3cd1.. has dos attribute\n\"readonly\". Toggling this attribute on any file does not seem to have\nan effect on git repack. Both packs are present in\n.git/objects/info/packs.\nDeleting it by hand followed by repack -ad and fsck seems to work\nthough, which means it was redundant yet not removed by repack.\n\n> Could you share that repo or is it private?\n\nUnfortunately I can't.\n"}]}