{"thread":{"id":"13074","subject":"How to fetch missing pack","startedAt":"2008-04-12T12:07:12Z","lastAt":"2008-04-28T14:14:34Z","messageCount":10,"participants":["Jörg Sommer","Peter Baumann","Christian Couder","Shawn O. Pearce","Stephen R. van den Berg","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"74198","messageId":"slrng019fg.nd8.joerg@alea.gnuu.de","threadId":"13074","inReplyTo":null,"subject":"How to fetch missing pack","fromName":"Jörg Sommer","fromEmail":"joerg@alea.gnuu.de","sentAt":"2008-04-12T12:07:12Z","receivedAt":"2008-04-12T12:07:12Z","isPatch":false,"sender":{"key":"joerg@alea.gnuu.de","avatar":null},"body":"Hi,\n\nI'm missing a pack. My history of the git repository is broken:\n% git show --pretty=raw e0fda6ab|head -7\ncommit e0fda6abd11c567b72f29ec0ee06c541404a9cb7\ntree 77a7e4a849bbec646d88ae863f80ea3f519e26bd\nparent 1ab58e8d6f728cdde0057f7ee88daab3a1c2d06f\nauthor Wincent Colaiuta <win@wincent.com> 1196066088 +0100\ncommitter Junio C Hamano <gitster@pobox.com> 1196109124 -0800\n\n    Fix typo in draft 1.5.4 release notes\n% git log --pretty=oneline e0fda6ab | wc -l\n1\n% git show e0fda6ab~1|cat\nfatal: ambiguous argument 'e0fda6ab~1': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\n\nCan I somehow tell git fetch to check the whole history for holes and\nfetch missing packs?\n\nBye, Jörg.\n-- \nDer kommt den Göttern am nächsten, der auch dann schweigen kann,\nwenn er im Recht ist.                         (Cato; 234–149 v. Chr.)\n"},{"id":"74249","messageId":"20080413094131.GA9437@xp.machine.xx","threadId":"13074","inReplyTo":"slrng019fg.nd8.joerg@alea.gnuu.de","subject":"Re: How to fetch missing pack","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2008-04-13T09:41:31Z","receivedAt":"2008-04-13T09:41:31Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Sat, Apr 12, 2008 at 12:07:12PM +0000, Jörg Sommer wrote:\n> Hi,\n> \n> I'm missing a pack. My history of the git repository is broken:\n> % git show --pretty=raw e0fda6ab|head -7\n> commit e0fda6abd11c567b72f29ec0ee06c541404a9cb7\n> tree 77a7e4a849bbec646d88ae863f80ea3f519e26bd\n> parent 1ab58e8d6f728cdde0057f7ee88daab3a1c2d06f\n> author Wincent Colaiuta <win@wincent.com> 1196066088 +0100\n> committer Junio C Hamano <gitster@pobox.com> 1196109124 -0800\n> \n>     Fix typo in draft 1.5.4 release notes\n> % git log --pretty=oneline e0fda6ab | wc -l\n> 1\n> % git show e0fda6ab~1|cat\n> fatal: ambiguous argument 'e0fda6ab~1': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> \n> Can I somehow tell git fetch to check the whole history for holes and\n> fetch missing packs?\n> \n> Bye, Jörg.\n\nTry using git fsck --full to check you repo. If you are missing some\nobjects, you could just grab them from another valid repo which still has\nthem. (e.g. copy all packs/objects from the other repo into yours and then\ndo a git-repack -a -d -f)\n\n-Peter\n"},{"id":"75106","messageId":"slrng0v8h8.ujv.joerg@alea.gnuu.de","threadId":"13074","inReplyTo":"20080413094131.GA9437@xp.machine.xx","subject":"Re: How to fetch missing pack","fromName":"Jörg Sommer","fromEmail":"joerg@alea.gnuu.de","sentAt":"2008-04-23T20:55:03Z","receivedAt":"2008-04-23T20:55:03Z","isPatch":false,"sender":{"key":"joerg@alea.gnuu.de","avatar":null},"body":"Hi Peter,\n\nPeter Baumann <waste.manager@gmx.de> wrote:\n> On Sat, Apr 12, 2008 at 12:07:12PM +0000, Jörg Sommer wrote:\n>> I'm missing a pack. My history of the git repository is broken:\n>> % git show --pretty=raw e0fda6ab|head -7\n>> commit e0fda6abd11c567b72f29ec0ee06c541404a9cb7\n>> tree 77a7e4a849bbec646d88ae863f80ea3f519e26bd\n>> parent 1ab58e8d6f728cdde0057f7ee88daab3a1c2d06f\n>> author Wincent Colaiuta <win@wincent.com> 1196066088 +0100\n>> committer Junio C Hamano <gitster@pobox.com> 1196109124 -0800\n>> \n>>     Fix typo in draft 1.5.4 release notes\n>> % git log --pretty=oneline e0fda6ab | wc -l\n>> 1\n>> % git show e0fda6ab~1|cat\n>> fatal: ambiguous argument 'e0fda6ab~1': unknown revision or path not in the working tree.\n>> Use '--' to separate paths from revisions\n>> \n>> Can I somehow tell git fetch to check the whole history for holes and\n>> fetch missing packs?\n>> \n>> Bye, Jörg.\n>\n> Try using git fsck --full to check you repo. If you are missing some\n> objects, you could just grab them from another valid repo which still has\n> them.\n\nHow can I exctract single objects from a pack?\n\n> (e.g. copy all packs/objects from the other repo into yours and then do\n> a git-repack -a -d -f)\n\nThis didn't work. I've cloned my git repo and copied the pack into\npacks/objects without the .keep file and removed objects/info/packs.\nAfter that I ran repack -a -d -f, but nothing changed. I still can't\naccess the parent of e0fda6ab. What else can I do?\n\nBye, Jörg.\n-- \nThe social dynamics of the net are a direct consequence of the fact\nthat nobody has yet developed a Remote Strangulation Protocol.\n            (Larry Wall)\n"},{"id":"75135","messageId":"200804240801.13674.chriscool@tuxfamily.org","threadId":"13074","inReplyTo":"slrng0v8h8.ujv.joerg@alea.gnuu.de","subject":"Re: How to fetch missing pack","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-04-24T06:01:13Z","receivedAt":"2008-04-24T06:01:13Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le mercredi 23 avril 2008, Jörg Sommer a écrit :\n> Hi Peter,\n>\n> Peter Baumann <waste.manager@gmx.de> wrote:\n> >\n> > Try using git fsck --full to check you repo. If you are missing some\n> > objects, you could just grab them from another valid repo which still\n> > has them.\n>\n> How can I exctract single objects from a pack?\n\nPlease have a look at this:\n\nhttp://git.or.cz/gitwiki/GitFaq#head-ac11406480d09e2df98588e800e41b7256602074\n\nRegards,\nChristian.\n"},{"id":"75137","messageId":"20080424060857.GX29771@spearce.org","threadId":"13074","inReplyTo":"200804240801.13674.chriscool@tuxfamily.org","subject":"Re: How to fetch missing pack","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-04-24T06:08:57Z","receivedAt":"2008-04-24T06:08:57Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> wrote:\n> Le mercredi 23 avril 2008, Jörg Sommer a écrit :\n> > Peter Baumann <waste.manager@gmx.de> wrote:\n> > >\n> > > Try using git fsck --full to check you repo. If you are missing some\n> > > objects, you could just grab them from another valid repo which still\n> > > has them.\n> >\n> > How can I exctract single objects from a pack?\n> \n> Please have a look at this:\n> \n> http://git.or.cz/gitwiki/GitFaq#head-ac11406480d09e2df98588e800e41b7256602074\n\nIf you know the name of the objects you are missing, you can\nmake a temporary pack to transfer the list of objects:\n\n\t# at good repo\n\t#\n\tgit pack-objects --stdout <object.list >save.pack\n\n\t# at bad repo\n\t#\n\tgit index-pack --stdin <save.pack\n\nMake object.list just one SHA-1 per line.  The resulting pack is\nnot likely to be highly compressed, as it will probably contain\na non-delta version of each object, but its faster to create than\ncalling git-cat-file for each object, and may give you a smaller\npack than just copying everything as the FAQ entry recommends.\n\nNote that you may need to do this several times; e.g. if you are\nmissing a tree you won't know what blobs you are missing until\nyou load the tree and run fsck --full again to parse the tree and\ndiscover the missing blobs.  This iterative copying approach is\nwhat the FAQ avoids when it suggests you copy everything.\n\n-- \nShawn.\n"},{"id":"75283","messageId":"20080427104704.GA11784@alea.gnuu.de","threadId":"13074","inReplyTo":"20080424060857.GX29771@spearce.org","subject":"git doesn't finds the parent of a commit (was: How to fetch missing pack)","fromName":"Jörg Sommer","fromEmail":"joerg@alea.gnuu.de","sentAt":"2008-04-27T10:47:04Z","receivedAt":"2008-04-27T10:47:04Z","isPatch":false,"sender":{"key":"joerg@alea.gnuu.de","avatar":null},"body":"Hi,\n\nShawn O. Pearce schrieb am Thu 24. Apr, 02:08 (-0400):\n> If you know the name of the objects you are missing, you can\n> make a temporary pack to transfer the list of objects:\n> \n> \t# at good repo\n> \t#\n> \tgit pack-objects --stdout <object.list >save.pack\n> \n> \t# at bad repo\n> \t#\n> \tgit index-pack --stdin <save.pack\n\nI didn't know the list of objects I'm missing, but I used this little\nscript do find them:\n\nanchor=7cb192eab0251911e2ca77d4ecceb621dd2d34f5\nwhile true\ndo\n    outp=$(git log --pretty=raw --raw $anchor 2>&1 >/dev/null)\n    echo $outp\n    [ $#outp -eq 0 ] && break\n    cmt=${${outp##* \\(}%\\)}\n    git cat-file -t $cmt >/dev/null 2>&1 && \\\n      cmt=$(git cat-file commit $cmt |grep '^tree ')\n    echo ${cmt##* } | ssh server cd git\\; git pack-objects --stdout | \\\n      git index-pack --stdin >/dev/null\ndone\n\nMaybe it helps someone else. :)\n\nBut now, there's something else broken.\n\n% git cat-file commit b63e99500137c913bd801a2f22b6cf88c63b95c5\ntree 68a58fb97935f35c6fb7bcbcfed73b1697db000a\nparent 3f061887c562b20d3ed3d1f764462cf986a1ad12\nauthor Wincent Colaiuta <win@wincent.com> 1195996542 +0100\ncommitter Junio C Hamano <gitster@pobox.com> 1196019475 -0800\n\nAdd \"--patch\" option to git-add--interactive\n\nWhen the \"--patch\" option is supplied, the patch_update_cmd() function is\n…\n\n% git cat-file commit 3f061887c562b20d3ed3d1f764462cf986a1ad12\ntree 636a0f9c085aac7ba539ef2ace03b3081481891a\nparent 324ccbd6a09816af830b22b02bbeb06349141849\nauthor Junio C Hamano <gitster@pobox.com> 1196014210 -0800\ncommitter Junio C Hamano <gitster@pobox.com> 1196014993 -0800\n\nadd -i: Fix running from a subdirectory\n\nThis fixes the pathspec interactive_add() passes to the underlying\n…\n\n% git rev-parse b63e99500137c913bd801a2f22b6cf88c63b95c5~1\nb63e99500137c913bd801a2f22b6cf88c63b95c5~1\nfatal: ambiguous argument 'b63e99500137c913bd801a2f22b6cf88c63b95c5~1': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\n\nCan someone tell me what I'm doing wrong?\n\n> Note that you may need to do this several times; e.g. if you are\n> missing a tree you won't know what blobs you are missing until\n> you load the tree and run fsck --full again to parse the tree and\n> discover the missing blobs.\n\nfsck --full reports only dangling objects, no breakage.\n\nBye, Jörg.\n-- \nDie zehn Gebote Gottes enthalten 172 Wörter, die amerikanische\nUnabhängigkeitserklärung 300 Wörter, die Verordnung der europäischen\nGemeinschaft über den Import von Karamelbonbons exakt 25911 Wörter.\n"},{"id":"75312","messageId":"20080427173731.GA9523@cuci.nl","threadId":"13074","inReplyTo":"20080427104704.GA11784@alea.gnuu.de","subject":"Re: git doesn't finds the parent of a commit (was: How to fetch missing pack)","fromName":"Stephen R. van den Berg","fromEmail":"srb@cuci.nl","sentAt":"2008-04-27T17:37:31Z","receivedAt":"2008-04-27T17:37:31Z","isPatch":false,"sender":{"key":"srb@cuci.nl","avatar":"https://gravatar.com/avatar/f75389059e827634d38e9df2a9b6ecbd50028b5a454442efa1c7205b7ff29c6a?d=mp&s=160"},"body":"J?rg Sommer wrote:\n>% git rev-parse b63e99500137c913bd801a2f22b6cf88c63b95c5~1\n>b63e99500137c913bd801a2f22b6cf88c63b95c5~1\n>fatal: ambiguous argument 'b63e99500137c913bd801a2f22b6cf88c63b95c5~1': unknown revision or path not in the working tree.\n>Use '--' to separate paths from revisions\n\n>Can someone tell me what I'm doing wrong?\n\nI've had similar symptoms when I had circular references in the\nrepository.  They're not reported by any of the existing checks, I've\nsubmitted a patch (resent it just now) which causes git to check for\n(and report) circular references when using --topo-order on e.g.\ngit-rev-list.\n-- \nSincerely,                                                          srb@cuci.nl\n           Stephen R. van den Berg.\n"},{"id":"75326","messageId":"7vtzhnf3w5.fsf@gitster.siamese.dyndns.org","threadId":"13074","inReplyTo":"20080427173731.GA9523@cuci.nl","subject":"Re: git doesn't finds the parent of a commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-27T20:18:18Z","receivedAt":"2008-04-27T20:18:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stephen R. van den Berg\" <srb@cuci.nl> writes:\n\n> J?rg Sommer wrote:\n>>% git rev-parse b63e99500137c913bd801a2f22b6cf88c63b95c5~1\n>>b63e99500137c913bd801a2f22b6cf88c63b95c5~1\n>>fatal: ambiguous argument 'b63e99500137c913bd801a2f22b6cf88c63b95c5~1': unknown revision or path not in the working tree.\n>>Use '--' to separate paths from revisions\n>\n>>Can someone tell me what I'm doing wrong?\n>\n> I've had similar symptoms when I had circular references in the\n> repository.  They're not reported by any of the existing checks, I've\n> submitted a patch (resent it just now) which causes git to check for\n> (and report) circular references when using --topo-order on e.g.\n> git-rev-list.\n\nAssuming that we never have SHA-1 hash collisions, the graft mechansim is\npractically the only way to get yourself into the circular reference\nsituation.\n\nPerhaps we should check this circularity when we install grafts instead of\nspecial casing the topo-order codepath?  How expensive would that\nalternative approach be?\n"},{"id":"75333","messageId":"20080427214621.GA30793@cuci.nl","threadId":"13074","inReplyTo":"7vtzhnf3w5.fsf@gitster.siamese.dyndns.org","subject":"Re: git doesn't finds the parent of a commit","fromName":"Stephen R. van den Berg","fromEmail":"srb@cuci.nl","sentAt":"2008-04-27T21:46:21Z","receivedAt":"2008-04-27T21:46:21Z","isPatch":false,"sender":{"key":"srb@cuci.nl","avatar":"https://gravatar.com/avatar/f75389059e827634d38e9df2a9b6ecbd50028b5a454442efa1c7205b7ff29c6a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n>\"Stephen R. van den Berg\" <srb@cuci.nl> writes:\n>> I've had similar symptoms when I had circular references in the\n>> repository.  They're not reported by any of the existing checks, I've\n>> submitted a patch (resent it just now) which causes git to check for\n>> (and report) circular references when using --topo-order on e.g.\n>> git-rev-list.\n\n>Assuming that we never have SHA-1 hash collisions, the graft mechansim is\n>practically the only way to get yourself into the circular reference\n>situation.\n\nTrue, I think.\n\n>Perhaps we should check this circularity when we install grafts instead of\n>special casing the topo-order codepath?  How expensive would that\n>alternative approach be?\n\nNot practical in its current form.\nChecking for circular references is O(n) in CPU and memory use relative\nto the number of commits in the entire repository.\n\nConsider:\n- The proposed check in the topo-order path is very low-cost, it costs a\n  single decrement/increment per commit (and will detect other circular\n  references not caused by the grafts mechanism, if they ever should occur).\n- If it is being done during the grafts install, then there should be a\n  flag-file (at least), which indicates when the grafts file has changed\n  since the last check.\n- It could/should be added to git-fsck.\n-- \nSincerely,                                                          srb@cuci.nl\n           Stephen R. van den Berg.\n"},{"id":"75404","messageId":"slrng1bmua.25r.joerg@alea.gnuu.de","threadId":"13074","inReplyTo":"20080427173731.GA9523@cuci.nl","subject":"Re: git doesn't finds the parent of a commit","fromName":"Jörg Sommer","fromEmail":"joerg@alea.gnuu.de","sentAt":"2008-04-28T14:14:34Z","receivedAt":"2008-04-28T14:14:34Z","isPatch":false,"sender":{"key":"joerg@alea.gnuu.de","avatar":null},"body":"Hallo,\n\n\"Stephen R. van den Berg\" <srb@cuci.nl> wrote:\n> J?rg Sommer wrote:\n>>% git rev-parse b63e99500137c913bd801a2f22b6cf88c63b95c5~1\n>>b63e99500137c913bd801a2f22b6cf88c63b95c5~1\n>>fatal: ambiguous argument 'b63e99500137c913bd801a2f22b6cf88c63b95c5~1': unknown revision or path not in the working tree.\n>>Use '--' to separate paths from revisions\n>\n>>Can someone tell me what I'm doing wrong?\n>\n> I've had similar symptoms when I had circular references in the\n> repository.\n\nNo, this was not my problem. But I found the reason with bisect:\n.git/shallow. I've started with a shallow clone, but forgot it. Is it\npossible that git warns about this or ignores the shallow entry if the\nparent of the commit is available?\n\nBye, Jörg.\n-- \nDein Gesicht wird dir geschenkt. Lächeln musst du selber! (Inga Hermann)\n"}]}