On Mon, Jun 11, 2012 at 9:15 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > vfr@xxxxxxx writes: > >> From: Vincent van Ravesteijn <vfr@xxxxxxx> >> >> GIT-BUILD-OPTIONS defines PERL_PATH to be used in the test suite. Only a >> few tests already actually use this variable when perl is needed. The >> other test just call 'perl' and it might happen that the wrong perl >> interpreter is used. >> >> This becomes problematic on Windows, when the perl interpreter that is >> compiled and installed on the Windows system is used, because this perl >> interpreter might introduce some unexpected LF->CRLF conversions. >> >> This patch makes sure that $PERL_PATH is used everywhere in the test suite >> and that the correct perl interpreter is used. >> >> Signed-off-by: Vincent van Ravesteijn <vfr@xxxxxxx> >> --- > > There was already this discussion: > > http://thread.gmane.org/gmane.comp.version-control.git/132560/focus=132561 > > which basically dismissed effort along this line with "If the perl > in your PATH is so broken that it can't be used for simple helpers, > then you should fix your PATH." > This way of looking at it has the flaw that it might not be the Perl that is "broken", it could be that Git is the guilty one for creating problems. The reason in this case is that pipes are text-mode by default, which means newlines get translated between LF and CRLF on Windows. However, Git is largely written for Unixy systems where there's no CRLF-translation going on. Because a lot of the internal Git protocols assume they can send binary data over stdin/stdout by default, we set these to binary mode on startup in Git for Windows to avoid. This cause problems with external tools like Perl, but we currently ship an MSYS version of perl where text-mode means LF-newlines, and thus no translation. Having an MSYS version of Perl in PATH is "broken" in the Windows world, so it's THIS Perl that people might want to keep out of their PATH. That being said, it should be possible (and probably desirable) to have a different PATH for the MSYS environment. But I'm not sure how well this works for people who run Git for Windows from cmd, as opposed to from MSYS. In the long run, it would probably be better to default to text-mode, and explicitly switch between text and binary-mode when needed. But for now, the binary-pipe-hack "almost works" ;) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html