{"thread":{"id":"40162","subject":"git-remote-helper behavior on Windows, not recognizing blank line as terminator","startedAt":"2015-08-23T18:40:17Z","lastAt":"2015-08-25T01:52:15Z","messageCount":3,"participants":["Anish Athalye","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"268540","messageId":"CAFQ6zU1bdUwn+P3=1v2DoyVubMFz29ZuxHmnZ0pfezA-0MB+mQ@mail.gmail.com","threadId":"40162","inReplyTo":null,"subject":"git-remote-helper behavior on Windows, not recognizing blank line as terminator","fromName":"Anish Athalye","fromEmail":"anish.athalye@gmail.com","sentAt":"2015-08-23T18:40:17Z","receivedAt":"2015-08-23T18:40:17Z","isPatch":false,"sender":{"key":"anish.athalye@gmail.com","avatar":null},"body":"Hello,\n\nI'm having some issues with git remote helper behavior on Windows.\n\nAccording to the protocol\n(https://www.kernel.org/pub/software/scm/git/docs/gitremote-helpers.html),\nwhen doing things like listing capabilities, git expects the remote\nhelper to send back a blank line when it's done.\n\nI'm having trouble having git recognize the blank line (see\nhttps://github.com/anishathalye/git-remote-dropbox/issues/13#issuecomment-133894730\nfor details).\n\nHas anyone come across this behavior before? Am I doing something\nwrong, or could there be a bug in git? What's the best way to proceed?\n\n\nAny help or suggestions would be greatly appreciated!\n\nRegards,\nAnish\n"},{"id":"268560","messageId":"20150824092418.GF1412@serenity.lan","threadId":"40162","inReplyTo":"CAFQ6zU1bdUwn+P3=1v2DoyVubMFz29ZuxHmnZ0pfezA-0MB+mQ@mail.gmail.com","subject":"Re: git-remote-helper behavior on Windows, not recognizing blank line as terminator","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-08-24T09:24:18Z","receivedAt":"2015-08-24T09:24:18Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sun, Aug 23, 2015 at 11:40:17AM -0700, Anish Athalye wrote:\n> I'm having some issues with git remote helper behavior on Windows.\n> \n> According to the protocol\n> (https://www.kernel.org/pub/software/scm/git/docs/gitremote-helpers.html),\n> when doing things like listing capabilities, git expects the remote\n> helper to send back a blank line when it's done.\n> \n> I'm having trouble having git recognize the blank line (see\n> https://github.com/anishathalye/git-remote-dropbox/issues/13#issuecomment-133894730\n> for details).\n> \n> Has anyone come across this behavior before? Am I doing something\n> wrong, or could there be a bug in git? What's the best way to proceed?\n> \n> \n> Any help or suggestions would be greatly appreciated!\n\nThe remote-helper parser tends to be very strict about its input.  I\nsuspect that on Windows you are sending CRLF rather than LF, so Git sees\na line containing CR.\n\nBy default the stdio streams are probably open in \"text\" mode, which\nwill convert \"\\n\" to \"\\r\\n\".  You probably need to reopen stdout in\nbinary mode to make sure the output is correct.\n"},{"id":"268622","messageId":"304662DC-3759-4482-A06C-3286FD45457F@gmail.com","threadId":"40162","inReplyTo":"20150824092418.GF1412@serenity.lan","subject":"Re: git-remote-helper behavior on Windows, not recognizing blank line as terminator","fromName":"Anish Athalye","fromEmail":"anish.athalye@gmail.com","sentAt":"2015-08-25T01:52:15Z","receivedAt":"2015-08-25T01:52:15Z","isPatch":false,"sender":{"key":"anish.athalye@gmail.com","avatar":null},"body":"Wow, yeah, that was it. Thanks for your help!\n\n\n\n> On Aug 24, 2015, at 2:24 AM, John Keeping <john@keeping.me.uk> wrote:\n> \n>> On Sun, Aug 23, 2015 at 11:40:17AM -0700, Anish Athalye wrote:\n>> I'm having some issues with git remote helper behavior on Windows.\n>> \n>> According to the protocol\n>> (https://www.kernel.org/pub/software/scm/git/docs/gitremote-helpers.html),\n>> when doing things like listing capabilities, git expects the remote\n>> helper to send back a blank line when it's done.\n>> \n>> I'm having trouble having git recognize the blank line (see\n>> https://github.com/anishathalye/git-remote-dropbox/issues/13#issuecomment-133894730\n>> for details).\n>> \n>> Has anyone come across this behavior before? Am I doing something\n>> wrong, or could there be a bug in git? What's the best way to proceed?\n>> \n>> \n>> Any help or suggestions would be greatly appreciated!\n> \n> The remote-helper parser tends to be very strict about its input.  I\n> suspect that on Windows you are sending CRLF rather than LF, so Git sees\n> a line containing CR.\n> \n> By default the stdio streams are probably open in \"text\" mode, which\n> will convert \"\\n\" to \"\\r\\n\".  You probably need to reopen stdout in\n> binary mode to make sure the output is correct.\n"}]}