{"thread":{"id":"26626","subject":"problem with updating a shallow clone via a branch fetch","startedAt":"2011-03-01T00:12:21Z","lastAt":"2012-01-13T04:09:59Z","messageCount":4,"participants":["Rick Bradley","Junio C Hamano","Rahul Jain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162497","messageId":"AANLkTinx01bzzLKk=DfyEvfSz8Hun-YqzJfEDpX7gNSS@mail.gmail.com","threadId":"26626","inReplyTo":null,"subject":"problem with updating a shallow clone via a branch fetch","fromName":"Rick Bradley","fromEmail":"rick@rickbradley.com","sentAt":"2011-03-01T00:12:21Z","receivedAt":"2011-03-01T00:12:21Z","isPatch":false,"sender":{"key":"rick@rickbradley.com","avatar":null},"body":"So I have a git repo that is shallow cloned:\n\n  % git clone --depth 1 <repo url>\n\nSometimes (very rarely), when I do a branch fetch to update that\nrepository I get an error:\n\n % git fetch origin +refs/head/<branch>:refs/remotes/origin/<branch>\n\nfatal: did not find object for shallow <hash>\n\nThere are only 3 mentions of this error on google, none of which are\nenlightening.  The error is being emitted by receive_need(void) in\nupload-pack.c.  The commit in question exists in the named branch in\nthe upstream repository, and I'm not aware that anything sketchy\n(forced pushes, etc.) has gone on.  I'm going to continue to research\nthe history of the repo and the deployment, but I can't seem to get\nany insight on what the error actually means (i.e., what conditions\nwould cause this error to be triggered).\n\nAny help is appreciated,\nRick\n"},{"id":"162498","messageId":"7vtyfng00i.fsf@alter.siamese.dyndns.org","threadId":"26626","inReplyTo":"AANLkTinx01bzzLKk=DfyEvfSz8Hun-YqzJfEDpX7gNSS@mail.gmail.com","subject":"Re: problem with updating a shallow clone via a branch fetch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-03-01T00:25:17Z","receivedAt":"2011-03-01T00:25:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rick Bradley <rick@rickbradley.com> writes:\n\n> So I have a git repo that is shallow cloned:\n>\n>   % git clone --depth 1 <repo url>\n>\n> Sometimes (very rarely), when I do a branch fetch to update that\n> repository I get an error:\n>\n>  % git fetch origin +refs/head/<branch>:refs/remotes/origin/<branch>\n>\n> fatal: did not find object for shallow <hash>\n\nThe message comes from the repository you are fetching from.  When you\nfetch from a shallow clone, the fetch process on your end tells the other\nside what commits your incomplete history ends at, and if the other end\ndoes not have any of these commits, you get that message.  So the only\ncase (unless there is a bug---and I don't think this codepath is heavily\nexercised so it is very possible there are bugs) you would see that\nmessage is if the other side rewound the branch and then later garbage\ncollection lost the commit.\n"},{"id":"162511","messageId":"AANLkTimSRG+UkD1vJszUf+3j0nV+_pPWSE3N2Dy9SfTa@mail.gmail.com","threadId":"26626","inReplyTo":"7vtyfng00i.fsf@alter.siamese.dyndns.org","subject":"Re: problem with updating a shallow clone via a branch fetch","fromName":"Rick Bradley","fromEmail":"rick@rickbradley.com","sentAt":"2011-03-01T02:07:35Z","receivedAt":"2011-03-01T02:07:35Z","isPatch":false,"sender":{"key":"rick@rickbradley.com","avatar":null},"body":"Junio,\nThanks for the assistance.  I'll be looking in the direction of what\ncould have caused sanity problems in the upstream repo.  If it happens\nagain and we can collect more tea leaves (this checkout was cleaned up\nbefore I could get a copy of it to do further diagnosis :-/) I'll see\nwhat else we can find out.\n\nRick\n\nOn Mon, Feb 28, 2011 at 6:25 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Rick Bradley <rick@rickbradley.com> writes:\n>\n>> So I have a git repo that is shallow cloned:\n>>\n>>   % git clone --depth 1 <repo url>\n>>\n>> Sometimes (very rarely), when I do a branch fetch to update that\n>> repository I get an error:\n>>\n>>  % git fetch origin +refs/head/<branch>:refs/remotes/origin/<branch>\n>>\n>> fatal: did not find object for shallow <hash>\n>\n> The message comes from the repository you are fetching from.  When you\n> fetch from a shallow clone, the fetch process on your end tells the other\n> side what commits your incomplete history ends at, and if the other end\n> does not have any of these commits, you get that message.  So the only\n> case (unless there is a bug---and I don't think this codepath is heavily\n> exercised so it is very possible there are bugs) you would see that\n> message is if the other side rewound the branch and then later garbage\n> collection lost the commit.\n>\n"},{"id":"182478","messageId":"loom.20120113T050744-134@post.gmane.org","threadId":"26626","inReplyTo":"AANLkTimSRG+UkD1vJszUf+3j0nV+_pPWSE3N2Dy9SfTa@mail.gmail.com","subject":"Re: problem with updating a shallow clone via a branch fetch","fromName":"Rahul Jain","fromEmail":"rahuljain81@gmail.com","sentAt":"2012-01-13T04:09:59Z","receivedAt":"2012-01-13T04:09:59Z","isPatch":false,"sender":{"key":"rahuljain81@gmail.com","avatar":null},"body":"I was also getting the same error. I went to .git/shallow file and deleted \n<hash>. After that everything was working fine.\n"}]}