On 2017-04-24 19:00, Torsten Bögershausen wrote:
> On 2017-04-24 18:45, Lars Schneider wrote:
>> Hi,
>>
>> "t0025.3 - crlf=true causes a CRLF file to be normalized" failed
>> sporadically on next and master recently:
>> https://travis-ci.org/git/git/jobs/225084459#L2382
>> https://travis-ci.org/git/git/jobs/223830505#L2342
>>
>> Are you aware of a race condition in the code
>> or in the test?
> Not yet - I'll have a look
>
So,
The test failed under Linux & pu of the day, using Peff's
stress script.
not ok 3 - crlf=true causes a CRLF file to be normalized
The good case (simplified):
$ git status
modified: CRLFonly
Untracked files:
.gitattributes
$ git diff | tr "\015" Q
warning: CRLF will be replaced by LF in CRLFonly.
The file will have its original line endings in your working directory.
diff --git a/CRLFonly b/CRLFonly
index 44fc21c..666dbf4 100644
--- a/CRLFonly
+++ b/CRLFonly
@@ -1,7 +1,7 @@
-IQ
-amQ
-veryQ
-veryQ
-fineQ
-thankQ
-youQ
+I
+am
+very
+very
+fine
+thank
+you
--------------------
The failed case:
$ git status
Untracked files:
.gitattributes
-----------------------
$ ls -al -i
total 28
3430195 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 .
3427617 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 ..
3429958 -rw-r--r-- 1 tb tb 37 Apr 24 21:19 CRLFonly
3432574 drwxr-xr-x 8 tb tb 4096 Apr 24 21:27 .git
3425599 -rw-r--r-- 1 tb tb 14 Apr 24 21:19 .gitattributes
3430089 -rw-r--r-- 1 tb tb 24 Apr 24 21:19 LFonly
3430174 -rw-r--r-- 1 tb tb 36 Apr 24 21:19 LFwithNUL
-----------------
#After
$ mv CRLFonly tmp
$ cp tmp CRLFonly
$ ls -al -i
3430195 drwxr-xr-x 3 tb tb 4096 Apr 24 21:36 .
3427617 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 ..
3401599 -rw-r--r-- 1 tb tb 37 Apr 24 21:36 CRLFonly
3432574 drwxr-xr-x 8 tb tb 4096 Apr 24 21:36 .git
3425599 -rw-r--r-- 1 tb tb 14 Apr 24 21:19 .gitattributes
3430089 -rw-r--r-- 1 tb tb 24 Apr 24 21:19 LFonly
3430174 -rw-r--r-- 1 tb tb 36 Apr 24 21:19 LFwithNUL
3429958 -rw-r--r-- 1 tb tb 37 Apr 24 21:19 tmp
$ git status
modified: CRLFonly
Untracked files:
.gitattributes
tmp
So all in all it seams as if there is a very old race condition here,
which we "never" have seen yet.
Moving the file to a different inode number fixes the test case,
Git doesn't treat it as unchanged any more.