git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Christian Halstrick
Message 2 of 2 in “how to produce an index with smudged entries”
  1. Christian HalstrickSep 30, 2011
  2. Robin RosenbergOct 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.