{"thread":{"id":"26508","subject":"Corrupted git repository?","startedAt":"2011-02-15T14:57:20Z","lastAt":"2011-02-16T19:21:47Z","messageCount":5,"participants":["Piotr Krukowiecki","Junio C Hamano","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"161190","messageId":"AANLkTimMon7ztbyT26YhotiZ=jd=QpNTvOkPCKwHg+e_@mail.gmail.com","threadId":"26508","inReplyTo":null,"subject":"Corrupted git repository?","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki.news@gmail.com","sentAt":"2011-02-15T14:57:20Z","receivedAt":"2011-02-15T14:57:20Z","isPatch":false,"sender":{"key":"piotr.krukowiecki.news@gmail.com","avatar":null},"body":"Hi,\n\nit looks like my git repository got corrupted today.\n\ngit status shows no changes,\ngit cherry-pick says \"error: Your local changes to the following files\nwould be overwritten by merge:\",\ngit fsck starts checking objects but hangs on one \"Checking tree\"\n\nOther commands (gc, checkout, reset) seem to work correctly.\n\nI've tried hard resetting to HEAD, didn't help.\n\nWhat can I do? Cloning is very expensive operation here.\n\n-- \nPiotrek\n"},{"id":"161207","messageId":"7vk4h1nk3x.fsf@alter.siamese.dyndns.org","threadId":"26508","inReplyTo":"AANLkTimMon7ztbyT26YhotiZ=jd=QpNTvOkPCKwHg+e_@mail.gmail.com","subject":"Re: Corrupted git repository?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-15T20:00:50Z","receivedAt":"2011-02-15T20:00:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Piotr Krukowiecki <piotr.krukowiecki.news@gmail.com> writes:\n\n> it looks like my git repository got corrupted today.\n>\n> git status shows no changes,\n> git cherry-pick says \"error: Your local changes to the following files\n> would be overwritten by merge:\",\n\nwith some paths, or without naming any path?\n\n> git fsck starts checking objects but hangs on one \"Checking tree\"\n\nI take it that you are talking about \"git fsck -v\".  Is it really \"hangs\",\nor just \"takes a long time\"?  You mentioned that a clone is expensive so I\nam guessing that your repository has some huge trees or objects in\ngeneral.\n\nThe details you gave in your message are a bit sketchy to give you an\nexact diagnosis, but if \"cherry-pick\" stops with the above message and\ntells you the names of files that are not tracked in your current branch,\nI don't see there is anything unusual going on.  You have these files with\nrandom contents that git does not know about, and git is refusing to\nlose their contents by overwriting them during the cherry-pick.\n\nAfter making sure that they are indeed untracked paths, if you think you\ncan remove them (or move them away), first do so and retry cherry-pick,\nand then everything should be Ok.\n"},{"id":"161309","messageId":"AANLkTimZgpWUAncLgO=y5CvKsYGdYWTHNUzncjrC5UO6@mail.gmail.com","threadId":"26508","inReplyTo":"7vk4h1nk3x.fsf@alter.siamese.dyndns.org","subject":"Re: Corrupted git repository?","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki@gmail.com","sentAt":"2011-02-16T16:44:03Z","receivedAt":"2011-02-16T16:44:03Z","isPatch":false,"sender":{"key":"piotr.krukowiecki@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3259959?v=4"},"body":"On Tue, Feb 15, 2011 at 9:00 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Piotr Krukowiecki <piotr.krukowiecki.news@gmail.com> writes:\n>\n>> it looks like my git repository got corrupted today.\n>>\n>> git status shows no changes,\n>> git cherry-pick says \"error: Your local changes to the following files\n>> would be overwritten by merge:\",\n>\n> with some paths, or without naming any path?\n\nWith one path:\n\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n\n$ git cherry-pick 7d193bb0c1f14908361d9d9d5e30f0c12d5f2c2f\nerror: Your local changes to the following files would be overwritten by merge:\n\t<<PATH>>\nPlease, commit your changes or stash them before you can merge.\nAborting\n\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n\n7d193bb comes from trunk, master was reset to a branch,\nthe <<PATH>> is a file that was not changed in the commit,\ngit clean -n -- <<PATH>> does not show anything\n\nThey should not have \"assume unchanged\" bit because I did\ngit update-index --no-assume-unchanged --verbose -- <<PATH>>\n\n\n>> git fsck starts checking objects but hangs on one \"Checking tree\"\n>\n> I take it that you are talking about \"git fsck -v\".  Is it really \"hangs\",\n> or just \"takes a long time\"?\n\nI was too hasty - fsck finished fine. It just took long time for one object\n(a couple of minutes while other checked objects took less than second).\n\nIt only printed several dangling objects:\n\n$ git fsck\ndangling tree 0ff163a56128d95c5b88c520f68792f6f900bb18\ndangling commit deb988eeb2404dd1e57c8894c3cfd93dd316aca3\ndangling tree 50323779bd6c0d4eb19664a3945c6c31fe9dadd4\ndangling commit 9ed87852fdf6775a3c071faec05388eda5cd5de1\ndangling commit a4d09c76a1b58bbf51f2b701407493c5ed9f9b78\n\n\n> You mentioned that a clone is expensive so I\n> am guessing that your repository has some huge trees or objects in\n> general.\n\nThat's one reason, the other is that I'm using git-svn ...\n\n\n> The details you gave in your message are a bit sketchy to give you an\n> exact diagnosis, but if \"cherry-pick\" stops with the above message and\n> tells you the names of files that are not tracked in your current branch,\n\n\"git log -- <<PATH>>\" shows two commits for this file on this branch and\non trunk, and \"git status\" does not list the file as untracked.\n\n\n> I don't see there is anything unusual going on.  You have these files with\n> random contents that git does not know about, and git is refusing to\n> lose their contents by overwriting them during the cherry-pick.\n>\n> After making sure that they are indeed untracked paths, if you think you\n> can remove them (or move them away), first do so and retry cherry-pick,\n> and then everything should be Ok.\n\nI believe the file is tracked and is not modified?\n\nI have deleted the whole top-level directory in which the file was and run:\n\n$ git status | grep  <<PATH>>\n#\tdeleted:    <<PATH>>\n\n$ git checkout -- <<top dir>>\n\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n\n$ git cherry-pick 7d193bb0c1f14908361d9d9d5e30f0c12d5f2c2f\nerror: Your local changes to the following files would be overwritten by merge:\n\t<<PATH>>\nPlease, commit your changes or stash them before you can merge.\nAborting\n\n\n-- \nPiotrek\n"},{"id":"161322","messageId":"201102161954.26766.j6t@kdbg.org","threadId":"26508","inReplyTo":"AANLkTimZgpWUAncLgO=y5CvKsYGdYWTHNUzncjrC5UO6@mail.gmail.com","subject":"Re: Corrupted git repository?","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2011-02-16T18:54:26Z","receivedAt":"2011-02-16T18:54:26Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Mittwoch, 16. Februar 2011, Piotr Krukowiecki wrote:\n> I have deleted the whole top-level directory in which the file was and run:\n>\n> $ git status | grep  <<PATH>>\n> #\tdeleted:    <<PATH>>\n>\n> $ git checkout -- <<top dir>>\n>\n> $ git status\n> # On branch master\n> nothing to commit (working directory clean)\n>\n> $ git cherry-pick 7d193bb0c1f14908361d9d9d5e30f0c12d5f2c2f\n> error: Your local changes to the following files would be overwritten by\n> merge: <<PATH>>\n> Please, commit your changes or stash them before you can merge.\n> Aborting\n\nA wild guess: You are on Windows or OS/X, and the file exists in your worktree \nwith different uppercase/lowercase name? Rename the file so that its case is \nthe same as it is recorded in the repository.\n\n-- Hannes\n"},{"id":"161325","messageId":"AANLkTimkMSxwkEJGgVrOEOSNFd34DypUQita8n=9jiS0@mail.gmail.com","threadId":"26508","inReplyTo":"201102161954.26766.j6t@kdbg.org","subject":"Re: Corrupted git repository?","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki@gmail.com","sentAt":"2011-02-16T19:21:47Z","receivedAt":"2011-02-16T19:21:47Z","isPatch":false,"sender":{"key":"piotr.krukowiecki@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3259959?v=4"},"body":"On Wed, Feb 16, 2011 at 7:54 PM, Johannes Sixt <j6t@kdbg.org> wrote:\n> On Mittwoch, 16. Februar 2011, Piotr Krukowiecki wrote:\n>> I have deleted the whole top-level directory in which the file was and run:\n>>\n>> $ git status | grep  <<PATH>>\n>> #     deleted:    <<PATH>>\n>>\n>> $ git checkout -- <<top dir>>\n>>\n>> $ git status\n>> # On branch master\n>> nothing to commit (working directory clean)\n>>\n>> $ git cherry-pick 7d193bb0c1f14908361d9d9d5e30f0c12d5f2c2f\n>> error: Your local changes to the following files would be overwritten by\n>> merge: <<PATH>>\n>> Please, commit your changes or stash them before you can merge.\n>> Aborting\n>\n> A wild guess: You are on Windows or OS/X, and the file exists in your worktree\n> with different uppercase/lowercase name? Rename the file so that its case is\n> the same as it is recorded in the repository.\n\nNope, I'm on linux with case-sensitive file system.\n\nSome commits to svn repository are coming from windows. But the cherry-picked\none was my commit from linux. It was first done in git, then dcomitted\nto svn and\nthen I tried to merge it to git branch - that failed.\n\n\n-- \nPiotrek\n"}]}