Re: how to produce an index with smudged entries
- From
Robin Rosenberg <robin.rosenberg@dewire.com>
- Date
- Oct 2, 2011, 13:10 UTC
- Message-ID
- <4E8862C0.7010906@dewire.com>
- In-Reply-To
- <CAENte7h-sbv7VTBdV7A+=TtONTpgOBBfVWz2Nejm1DqJJ9tFiQ@mail.gmail.com>
Christian Halstrick skrev 2011-09-30 17.33:
> I am trying to find out how native git handles the racy git problem. I > read https://raw.github.com/git/git/master/Documentation/technical/racy-git.txt. > But I cannot reproduce the behaviour described in this text.
I guess that code is only likely to work if USE_NSEC is not set or the file system has only whole second resolution. It might be very hard to reproduce the situation since the likehood that a file AND the index has the same timestamp at the subsecond level is very small. Nasty thing to test :)
Is your file system one that does not have subsecond timestamp resolution? The nanosecond part of the timestamp(s) should be 0 (byte 24-27 for mtime for the first index entry).
Touch can set the timestamp to an explicit value, so you can use that instead of waiting for luck. Touch cannot set ctime, but you can make git ignore ctime by setting core.trustctime to false.
For testing the issue with nanosecond resolution you have to roll your own touch in C, perl or even Java.
-- robin