{"thread":{"id":"2699","subject":"use binmode(STDOUT) in git-status","startedAt":"2005-11-28T07:34:50Z","lastAt":"2005-11-29T23:56:12Z","messageCount":11,"participants":["Alex Riesen","H. Peter Anvin","Johannes Schindelin","Junio C Hamano","Tim O'Callaghan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12847","messageId":"81b0412b0511272334w393434e7lad3e3b102e6c3e9e@mail.gmail.com","threadId":"2699","inReplyTo":null,"subject":"use binmode(STDOUT) in git-status","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-11-28T07:34:50Z","receivedAt":"2005-11-28T07:34:50Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Activision's Perl generates CRLF unless STDOUT is binmoded, which is\ninconsistent with other output of git-status.\n\n---\nI assume none _sane_ can want CRLF as line-ending...\n\n\nSubject: [PATCH] use binmode on STDOUT to avoid generation of CRLF by activision perl\n\nSigned-off-by: Alex Riesen <fork0@gmail.com>\n\n\n---\n\n git-status.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\napplies-to: c64901fa1a7f5fa19d025a315bcd1e5d5eae5d93\n0fc9f4bdb41725d2b2b54e70ff4740bdb826bdea\ndiff --git a/git-status.sh b/git-status.sh\nindex b90ffc1..2fc7595 100755\n--- a/git-status.sh\n+++ b/git-status.sh\n@@ -82,13 +82,14 @@ else\n         --exclude-per-directory=.gitignore\n fi |\n perl -e '$/ = \"\\0\";\n+\tbinmode(STDOUT);\n \tmy $shown = 0;\n \twhile (<>) {\n \t\tchomp;\n \t\ts|\\\\|\\\\\\\\|g;\n \t\ts|\\t|\\\\t|g;\n \t\ts|\\n|\\\\n|g;\n-\t\ts/^/#\t/;\n+\t\ts/^/#\\t/;\n \t\tif (!$shown) {\n \t\t\tprint \"#\\n# Untracked files:\\n\";\n \t\t\tprint \"#   (use \\\"git add\\\" to add to commit)\\n#\\n\";\n---\n0.99.9.GIT\n"},{"id":"12878","messageId":"438B2859.6060109@zytor.com","threadId":"2699","inReplyTo":"81b0412b0511272334w393434e7lad3e3b102e6c3e9e@mail.gmail.com","subject":"Re: use binmode(STDOUT) in git-status","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-11-28T15:55:05Z","receivedAt":"2005-11-28T15:55:05Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Alex Riesen wrote:\n> Activision's Perl generates CRLF unless STDOUT is binmoded, which is\n> inconsistent with other output of git-status.\n> \n> ---\n> I assume none _sane_ can want CRLF as line-ending...\n\nWell, if it's a text file we probably should use platform-native \nline-ending, and at least be tolerant of \\r\\n.\n\n\t-hpa\n"},{"id":"12879","messageId":"Pine.LNX.4.63.0511281700100.11362@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2699","inReplyTo":"438B2859.6060109@zytor.com","subject":"Re: use binmode(STDOUT) in git-status","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-28T16:02:22Z","receivedAt":"2005-11-28T16:02:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 28 Nov 2005, H. Peter Anvin wrote:\n\n> Alex Riesen wrote:\n> > Activision's Perl generates CRLF unless STDOUT is binmoded, which is\n> > inconsistent with other output of git-status.\n> > \n> > ---\n> > I assume none _sane_ can want CRLF as line-ending...\n> \n> Well, if it's a text file we probably should use platform-native line-ending,\n> and at least be tolerant of \\r\\n.\n\nOf course, here is the problem: git on Windows runs only using cygwin. You \ncan specify the line ending behaviour of cygwin (I think it is an env \nvariable). Activision Perl, being independent of cygwin, does not care \nabout that setting.\n\nSo, to be accurate, you'd have to check what *cygwin* expects, and \ndepending on that execute binmode(STDOUT) or not.\n\nCiao,\nDscho\n"},{"id":"12880","messageId":"438B2B90.9010500@zytor.com","threadId":"2699","inReplyTo":"Pine.LNX.4.63.0511281700100.11362@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: use binmode(STDOUT) in git-status","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-11-28T16:08:48Z","receivedAt":"2005-11-28T16:08:48Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Johannes Schindelin wrote:\n> \n> Of course, here is the problem: git on Windows runs only using cygwin. You \n> can specify the line ending behaviour of cygwin (I think it is an env \n> variable). Activision Perl, being independent of cygwin, does not care \n> about that setting.\n> \n> So, to be accurate, you'd have to check what *cygwin* expects, and \n> depending on that execute binmode(STDOUT) or not.\n> \n\nMakes sense, I guess... except if you're running Cygwin, wouldn't \nCygwin's Perl make a lot more sense?\n\n\t-hpa\n"},{"id":"12885","messageId":"Pine.LNX.4.63.0511281756001.11697@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2699","inReplyTo":"438B2B90.9010500@zytor.com","subject":"Re: use binmode(STDOUT) in git-status","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-28T16:56:58Z","receivedAt":"2005-11-28T16:56:58Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 28 Nov 2005, H. Peter Anvin wrote:\n\n> if you're running Cygwin, wouldn't Cygwin's Perl make a lot more sense?\n\nI thought so, too, but I guess there's a reason that Activision's perl was \nused.\n\nHth,\nDscho\n"},{"id":"12886","messageId":"7vd5kkvd3q.fsf@assigned-by-dhcp.cox.net","threadId":"2699","inReplyTo":"81b0412b0511272334w393434e7lad3e3b102e6c3e9e@mail.gmail.com","subject":"Re: use binmode(STDOUT) in git-status","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-28T18:31:05Z","receivedAt":"2005-11-28T18:31:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Activision's Perl generates CRLF unless STDOUT is binmoded, which is\n> inconsistent with other output of git-status.\n\nI do not think this is a kind of patch that I should accept to\napply to the generic part of the codepath, even if on sane\nplatforms binmode() could be a no-op.\n\nYou should not have to say binmode() when you are emitting plain\ntext (otherwise you have to say that everywhere which is\nmadness).  I presume the Cygwin version uses Perl from Cygwin\nand would not have this problem?\n\nIf that is the case, maybe this patch should be maintained out\nof tree by the maintainer of Windows port of git that does _not_\nuse Cygwin but ActiveState.\n"},{"id":"12924","messageId":"20051129100550.GA2124@ELSAMSW37164","threadId":"2699","inReplyTo":"7vd5kkvd3q.fsf@assigned-by-dhcp.cox.net","subject":"Re: use binmode(STDOUT) in git-status","fromName":"Tim O'Callaghan","fromEmail":"timo@dspsrv.com","sentAt":"2005-11-29T10:05:50Z","receivedAt":"2005-11-29T10:05:50Z","isPatch":false,"sender":{"key":"timo@dspsrv.com","avatar":null},"body":"On Mon, Nov 28, 2005 at 10:31:05AM -0800, Junio C Hamano wrote:\n> Alex Riesen <raa.lkml@gmail.com> writes:\n> \n> > Activision's Perl generates CRLF unless STDOUT is binmoded, which is\n> > inconsistent with other output of git-status.\n> \n> I do not think this is a kind of patch that I should accept to\n> apply to the generic part of the codepath, even if on sane\n> platforms binmode() could be a no-op.\n> \n> You should not have to say binmode() when you are emitting plain\n> text (otherwise you have to say that everywhere which is\n> madness).  I presume the Cygwin version uses Perl from Cygwin\n> and would not have this problem?\n> \n> If that is the case, maybe this patch should be maintained out\n> of tree by the maintainer of Windows port of git that does _not_\n> use Cygwin but ActiveState.\n>\n\nYou could also check `perl -v` for the phrase \"built for cygwin\". I am not\nsure how much of an issue this is though, because native windows support is\ngoing to be a bit tricky without Cygwin as you also need (ba)sh, sed, grep,\netc.\n\nTim.\n"},{"id":"12926","messageId":"Pine.LNX.4.63.0511291243090.2028@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2699","inReplyTo":"20051129100550.GA2124@ELSAMSW37164","subject":"Re: use binmode(STDOUT) in git-status","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-29T11:44:35Z","receivedAt":"2005-11-29T11:44:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 29 Nov 2005, Tim O'Callaghan wrote:\n\n> [...] native windows support is going to be a bit tricky without Cygwin \n> as you also need (ba)sh, sed, grep, etc.\n\n... most notably, not to forget fork().\n\nHth,\nDscho\n"},{"id":"12957","messageId":"20051129221221.GC3033@steel.home","threadId":"2699","inReplyTo":"Pine.LNX.4.63.0511281756001.11697@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: use binmode(STDOUT) in git-status","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-11-29T22:12:21Z","receivedAt":"2005-11-29T22:12:21Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Johannes Schindelin, Mon, Nov 28, 2005 17:56:58 +0100:\n> > if you're running Cygwin, wouldn't Cygwin's Perl make a lot more sense?\n> \n> I thought so, too, but I guess there's a reason that Activision's perl was \n> used.\n\nthe reason were incompatible scripts (notably, the ones expecting crlf).\n"},{"id":"12958","messageId":"7vwtir846o.fsf_-_@assigned-by-dhcp.cox.net","threadId":"2699","inReplyTo":"20051129221221.GC3033@steel.home","subject":"[OT] Activision (Re: use binmode(STDOUT) in git-status)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-29T22:44:31Z","receivedAt":"2005-11-29T22:44:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Johannes Schindelin, Mon, Nov 28, 2005 17:56:58 +0100:\n>> > if you're running Cygwin, wouldn't Cygwin's Perl make a lot more sense?\n>> \n>> I thought so, too, but I guess there's a reason that Activision's perl was \n>> used.\n>\n> the reason were incompatible scripts (notably, the ones expecting crlf).\n\nI wonder why people keep saying Activision ;-).  Taken with my\nuse of frotz and nitfol in the examples [*1*], somebody might\nconfuse us with a group of old Infocom [*2*] fans.\n\n[1] http://en.wikipedia.org/wiki/Nitfol\n[2] http://web.mit.edu/6.933/www/Fall2000/infocom/\n"},{"id":"12960","messageId":"Pine.LNX.4.63.0511300055360.22317@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2699","inReplyTo":"7vwtir846o.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [OT] Activision (Re: use binmode(STDOUT) in git-status)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-29T23:56:12Z","receivedAt":"2005-11-29T23:56:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 29 Nov 2005, Junio C Hamano wrote:\n\n> Alex Riesen <raa.lkml@gmail.com> writes:\n> \n> > Johannes Schindelin, Mon, Nov 28, 2005 17:56:58 +0100:\n> >> > if you're running Cygwin, wouldn't Cygwin's Perl make a lot more sense?\n> >> \n> >> I thought so, too, but I guess there's a reason that Activision's perl was \n> >> used.\n> >\n> > the reason were incompatible scripts (notably, the ones expecting crlf).\n> \n> I wonder why people keep saying Activision ;-).  Taken with my\n> use of frotz and nitfol in the examples [*1*], somebody might\n> confuse us with a group of old Infocom [*2*] fans.\n\nHey, you 0wn3d me there.\n"}]}