use binmode(STDOUT) in git-status

9 messages, 5 authors, 2016-06-15 · open the first message on its own page

use binmode(STDOUT) in git-status

From: Alex Riesen <hidden>
Date: 2016-06-15 22:42:13

Activision's Perl generates CRLF unless STDOUT is binmoded, which is
inconsistent with other output of git-status.

---
I assume none _sane_ can want CRLF as line-ending...

Re: use binmode(STDOUT) in git-status

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:13

Alex Riesen wrote:
Activision's Perl generates CRLF unless STDOUT is binmoded, which is
inconsistent with other output of git-status.

---
I assume none _sane_ can want CRLF as line-ending...
Well, if it's a text file we probably should use platform-native 
line-ending, and at least be tolerant of \r\n.

	-hpa

Re: use binmode(STDOUT) in git-status

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:13

Hi,

On Mon, 28 Nov 2005, H. Peter Anvin wrote:
Alex Riesen wrote:
quoted
Activision's Perl generates CRLF unless STDOUT is binmoded, which is
inconsistent with other output of git-status.

---
I assume none _sane_ can want CRLF as line-ending...
Well, if it's a text file we probably should use platform-native line-ending,
and at least be tolerant of \r\n.
Of course, here is the problem: git on Windows runs only using cygwin. You 
can specify the line ending behaviour of cygwin (I think it is an env 
variable). Activision Perl, being independent of cygwin, does not care 
about that setting.

So, to be accurate, you'd have to check what *cygwin* expects, and 
depending on that execute binmode(STDOUT) or not.

Ciao,
Dscho

Re: use binmode(STDOUT) in git-status

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:13

Johannes Schindelin wrote:
Of course, here is the problem: git on Windows runs only using cygwin. You 
can specify the line ending behaviour of cygwin (I think it is an env 
variable). Activision Perl, being independent of cygwin, does not care 
about that setting.

So, to be accurate, you'd have to check what *cygwin* expects, and 
depending on that execute binmode(STDOUT) or not.
Makes sense, I guess... except if you're running Cygwin, wouldn't 
Cygwin's Perl make a lot more sense?

	-hpa

Re: use binmode(STDOUT) in git-status

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:13

Hi,

On Mon, 28 Nov 2005, H. Peter Anvin wrote:
if you're running Cygwin, wouldn't Cygwin's Perl make a lot more sense?
I thought so, too, but I guess there's a reason that Activision's perl was 
used.

Hth,
Dscho

Re: use binmode(STDOUT) in git-status

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:13

Alex Riesen [off-list ref] writes:
Activision's Perl generates CRLF unless STDOUT is binmoded, which is
inconsistent with other output of git-status.
I do not think this is a kind of patch that I should accept to
apply to the generic part of the codepath, even if on sane
platforms binmode() could be a no-op.

You should not have to say binmode() when you are emitting plain
text (otherwise you have to say that everywhere which is
madness).  I presume the Cygwin version uses Perl from Cygwin
and would not have this problem?

If that is the case, maybe this patch should be maintained out
of tree by the maintainer of Windows port of git that does _not_
use Cygwin but ActiveState.

Re: use binmode(STDOUT) in git-status

From: Tim O'Callaghan <hidden>
Date: 2016-06-15 22:42:13

On Mon, Nov 28, 2005 at 10:31:05AM -0800, Junio C Hamano wrote:
Alex Riesen [off-list ref] writes:
quoted
Activision's Perl generates CRLF unless STDOUT is binmoded, which is
inconsistent with other output of git-status.
I do not think this is a kind of patch that I should accept to
apply to the generic part of the codepath, even if on sane
platforms binmode() could be a no-op.

You should not have to say binmode() when you are emitting plain
text (otherwise you have to say that everywhere which is
madness).  I presume the Cygwin version uses Perl from Cygwin
and would not have this problem?

If that is the case, maybe this patch should be maintained out
of tree by the maintainer of Windows port of git that does _not_
use Cygwin but ActiveState.
You could also check `perl -v` for the phrase "built for cygwin". I am not
sure how much of an issue this is though, because native windows support is
going to be a bit tricky without Cygwin as you also need (ba)sh, sed, grep,
etc.

Tim.

Re: use binmode(STDOUT) in git-status

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:13

Hi,

On Tue, 29 Nov 2005, Tim O'Callaghan wrote:
[...] native windows support is going to be a bit tricky without Cygwin 
as you also need (ba)sh, sed, grep, etc.
... most notably, not to forget fork().

Hth,
Dscho

Re: use binmode(STDOUT) in git-status

From: Alex Riesen <hidden>
Date: 2016-06-15 22:42:13

Johannes Schindelin, Mon, Nov 28, 2005 17:56:58 +0100:
quoted
if you're running Cygwin, wouldn't Cygwin's Perl make a lot more sense?
I thought so, too, but I guess there's a reason that Activision's perl was 
used.
the reason were incompatible scripts (notably, the ones expecting crlf).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help