# [PATCH] t0020: make sure the test file is lf to start with

4 messages from 2012-06-10 to 2012-06-10. Participants: vfr@lyx.org, Johannes Schindelin, Vincent van Ravesteijn.
Thread: https://gitlist.dev/t/30757

## vfr@lyx.org, 2012-06-10 10:32

Subject: [PATCH] t0020: make sure the test file is lf to start with
Message-ID: <1339324352-7376-1-git-send-email-vfr@lyx.org>
URL: https://gitlist.dev/e/1339324352-7376-1-git-send-email-vfr%40lyx.org

```
From: Vincent van Ravesteijn <vfr@lyx.org>

On Windows, the perl interpreter used by q_to_nul also converts the
eol-style to crlf. Because the eol-style is now wrong from the beginning, the
later tests '.gitattributes says two is binary' and 'checkout with
existing .gitattributes' fail. This patch makes sure that the eol-style is
lf when the test file is setup and makes the tests to pass also on
Windows.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>

---
I'm not sure everyone will like this solution to fix a problem that is only present on Windows. I'd be happy to discuss a different solution. 

 t/t0020-crlf.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 1a8f44c..4c41b6e 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -15,7 +15,7 @@ test_expect_success setup '
 	for w in Hello world how are you; do echo $w; done >one &&
 	mkdir dir &&
 	for w in I am very very fine thank you; do echo $w; done >dir/two &&
-	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul >three &&
+	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul | remove_cr >three &&
 	git add . &&
 
 	git commit -m initial &&
-- 
1.7.9.msysgit.0

```

## Johannes Schindelin, 2012-06-10 10:47

Subject: Re: [msysGit] [PATCH] t0020: make sure the test file is lf to start with
Message-ID: <alpine.DEB.1.00.1206101145550.16012@bonsai2>
URL: https://gitlist.dev/e/alpine.DEB.1.00.1206101145550.16012%40bonsai2
In-Reply-To: <1339324352-7376-1-git-send-email-vfr@lyx.org>

```
Hi Vincent,

On Sun, 10 Jun 2012, vfr@lyx.org wrote:

> On Windows, the perl interpreter used by q_to_nul also converts the
> eol-style to crlf.

First: thanks for working on this, and thanks also for Cc:ing the msysgit
list.

> Because the eol-style is now wrong from the beginning, the later tests
> '.gitattributes says two is binary' and 'checkout with existing
> .gitattributes' fail.

I wonder why it does not fail here:

	https://qa.nest-initiative.org/job/msysgit-test/24/console

IOW I think there is a difference between the msysGit setup and your
setup...

Ciao,
Johannes

```

## Vincent van Ravesteijn, 2012-06-10 11:01

Subject: Re: [PATCH] t0020: make sure the test file is lf to start with
Message-ID: <4FD47E99.2000004@lyx.org>
URL: https://gitlist.dev/e/4FD47E99.2000004%40lyx.org
In-Reply-To: <alpine.DEB.1.00.1206101145550.16012@bonsai2>

```
Op 10-6-2012 12:47, Johannes Schindelin schreef:
> Hi Vincent,
>
>> Because the eol-style is now wrong from the beginning, the later tests
>> '.gitattributes says two is binary' and 'checkout with existing
>> .gitattributes' fail.
> I wonder why it does not fail here:
>
> 	https://qa.nest-initiative.org/job/msysgit-test/24/console
>
> IOW I think there is a difference between the msysGit setup and your
> setup...

I compiled git using MSVC and try to run it in the Windows cmd prompt. 
Consequently it doesn't use the perl that is distributed with msysgit, 
but it uses the perl that I've installed on my Windows system 
(Strawberry Perl; http://strawberryperl.com/).

When I modify the paths such that git uses the perl.exe distributed with 
msysgit the tests run ok.

Vincent

-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

```

## Johannes Schindelin, 2012-06-10 12:50

Subject: Re: [PATCH] t0020: make sure the test file is lf to start with
Message-ID: <alpine.DEB.1.00.1206101349180.16012@bonsai2>
URL: https://gitlist.dev/e/alpine.DEB.1.00.1206101349180.16012%40bonsai2
In-Reply-To: <4FD47E99.2000004@lyx.org>

```
Hi Vincent,

On Sun, 10 Jun 2012, Vincent van Ravesteijn wrote:

> Op 10-6-2012 12:47, Johannes Schindelin schreef:
> >
> > > Because the eol-style is now wrong from the beginning, the later
> > > tests '.gitattributes says two is binary' and 'checkout with
> > > existing .gitattributes' fail.
>
> > I wonder why it does not fail here:
> >
> >  https://qa.nest-initiative.org/job/msysgit-test/24/console
> >
> > IOW I think there is a difference between the msysGit setup and your
> > setup...
> 
> I compiled git using MSVC and try to run it in the Windows cmd prompt.
> Consequently it doesn't use the perl that is distributed with msysgit,
> but it uses the perl that I've installed on my Windows system
> (Strawberry Perl; http://strawberryperl.com/).

Ah, now it makes sense. Maybe a valuable information to convey in the
commit message?

> When I modify the paths such that git uses the perl.exe distributed with
> msysgit the tests run ok.

Again, a valuable information for the commit message.

Also, I suspect that many, many more places should be affected by that
Perl's behavior...

Ciao,
Johannes

-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

```
