{"thread":{"id":"35587","subject":"aborted 'git fetch' leaves workspace unusable","startedAt":"2013-12-30T17:07:55Z","lastAt":"2013-12-30T19:54:38Z","messageCount":3,"participants":["stephen_leake@stephe-leake.org","Junio C Hamano","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"232513","messageId":"7adcf8024c435b9b7178b86f01e447bb@stephe-leake.org","threadId":"35587","inReplyTo":null,"subject":"aborted 'git fetch' leaves workspace unusable","fromName":"","fromEmail":"stephen_leake@stephe-leake.org","sentAt":"2013-12-30T17:07:55Z","receivedAt":"2013-12-30T17:07:55Z","isPatch":false,"sender":{"key":"stephen_leake@stephe-leake.org","avatar":null},"body":"I forgot to do 'ssh-add', so a 'git fetch' running under Windows Emacs\ntried to prompt for the ssh passphrase, could not find an ssh \npassphrase\nprompt program, and aborted.\n\nThat left the workspace unusable:\n\n- .git/FETCH_HEAD is empty\n\n     that causes 'git rev-parse FETCH_HEAD' to fail with a confusing\n     error message.\n\n- 'git fetch' just hangs after outputting:\n\nremote: Counting objects: 15, done.\nremote: Compressing objects: 100% (8/8), done.\nremote: Total 9 (delta 5), reused 0 (delta 0)\n\n     even with -v --progress\n\nA fresh clone allowed me to continue working, but this will happen\nagain, so I'd like a better fix.\n\nThe fetch is from stephen_leake@git.savannah.gnu.org/emacs/elpa.git\n\nI'm running git 1.7.9 from Cygwin. I have access to Debian, where I can\ncompile git and run it under the debugger, if that helps. I have not \nyet\ntried to reproduce this bug on Debian.\n\n--\n-- Stephe\n"},{"id":"232521","messageId":"xmqq8uv2ruyy.fsf@gitster.dls.corp.google.com","threadId":"35587","inReplyTo":"7adcf8024c435b9b7178b86f01e447bb@stephe-leake.org","subject":"Re: aborted 'git fetch' leaves workspace unusable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-30T19:37:25Z","receivedAt":"2013-12-30T19:37:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"stephen_leake@stephe-leake.org writes:\n\n> That left the workspace unusable:\n>\n> - .git/FETCH_HEAD is empty\n>\n>     that causes 'git rev-parse FETCH_HEAD' to fail with a confusing\n>     error message.\n\nThis is not limited to your Cygwin environment.  I can see that we\nleave an empty file there after a failed fetch with\n\n\t$ git fetch ssh://no.such.place/\n\nBut I would not call it leaving \"the workspace unusable\".  If you\nask \"git rev-parse\" \"What is in FETCH_HEAD?\", you would get \"that is\nnot even a revision\", which is what you would get.\n\nSimilar operations that try to use FETCH_HEAD as if there is a valid\nrevision, e.g. \"git merge FETCH_HEAD\", would also not work, which is\nvery much expected.  I wouldn't think that needs something drastic\nas \"this workspace is unusable, let's start from a new clone\".\n\nIf it really bothers you, you can always safely do\n\n\t$ rm -f .git/FETCH_HEAD\n\nbut of course, after that, nothing that tries to use FETCH_HEAD as\nif there is a valid revision, e.g. \"git show FETCH_HEAD\", would not\nwork until you fetch from somewhere, so there isn't that much to be\ngained by doing so.\n\n> - 'git fetch' just hangs after outputting:\n>\n> remote: Counting objects: 15, done.\n> remote: Compressing objects: 100% (8/8), done.\n> remote: Total 9 (delta 5), reused 0 (delta 0)\n\nThis looks more serious, but I suspect it is totally unrelated to\nyour previous fetch failing and leaving FETCH_HEAD there.  Is this\n\"'git fetch' hangs\" reproduce in a clean clone _without_ first\nencountering the failure (due to the forgotton \"ssh-add\")?\n"},{"id":"232523","messageId":"52C1CF7E.9000603@web.de","threadId":"35587","inReplyTo":"7adcf8024c435b9b7178b86f01e447bb@stephe-leake.org","subject":"Re: aborted 'git fetch' leaves workspace unusable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-12-30T19:54:38Z","receivedAt":"2013-12-30T19:54:38Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-12-30 18.07, stephen_leake@stephe-leake.org wrote:\n> I forgot to do 'ssh-add', so a 'git fetch' running under Windows Emacs\nWindows native emacs or emacs under cygwin ?\n> tried to prompt for the ssh passphrase, could not find an ssh passphrase\n> prompt program, and aborted.\n> \n> That left the workspace unusable:\n> \n> - .git/FETCH_HEAD is empty\n> \n>     that causes 'git rev-parse FETCH_HEAD' to fail with a confusing\n>     error message.\nWould you mind to post the \"confusion error message\" here?\nBecause some people may find it useful.\n> \n> - 'git fetch' just hangs after outputting:\n> \n> remote: Counting objects: 15, done.\n> remote: Compressing objects: 100% (8/8), done.\n> remote: Total 9 (delta 5), reused 0 (delta 0)\n> \n>     even with -v --progress\n> \n> A fresh clone allowed me to continue working, but this will happen\n> again, so I'd like a better fix.\n> \n> The fetch is from stephen_leake@git.savannah.gnu.org/emacs/elpa.git\n> \n> I'm running git 1.7.9 from Cygwin. \nThis feels old, we have v1.8.5.2 as the latest version.\n\nI have access to Debian, where I can\n> compile git and run it under the debugger, if that helps. I have not yet\n> tried to reproduce this bug on Debian.\nThis could be helpful:\na) compile git under cygwin (try 1.8.5.2), and see if the problem is still there.\nb) Which version of cygwin do you have? \nc) If the same problem exist under Debian, debugging it could be helpfull, yes.\n  If the same problem exist here, in some version of git, it would be helpful to test\n  the latest version of git. (Which means compile & debug)\nHTH\n/Torsten\n"}]}