File not marked as 'M' when contents differ from repo

Junio C Hamano gitster at pobox.com
Thu Aug 23 04:03:22 CDT 2007


Matt Mackall <mpm at selenic.com> writes:

> Changes that don't change file time OR size OR mode are indeed not
> detected.

We in the git land call this "racy git" problem, and call such
files "racily clean".

We have dealt with this problem by checking the contents of
potentially "racily clean" file whose timestamp match that of
the index [*1*].  After such a test, if such a "racily clean"
file is found to be modified, we drop the cached "size" field to
zero, so that later check with lstat(3) do not have to trigger
the contents comparison logic again.  The last trick of smudging
racily clean path takes advantage of the fact that a file with
0-byte contents cannot have been modified if the size does not
change ;-).

It appears that all SCM systems need to deal with this.  SVN has
been noted in this thread, and CVS has the same issue.  Linus
talks the problem in CVS's approach it in this thread:

    http://thread.gmane.org/gmane.comp.version-control.git/53306/focus=53630


[Footnote]

*1* I think the rough equivalent in Hg is whatever is described
in "Tracking Working Directory State" section of:

    http://www.selenic.com/mercurial/wiki/index.cgi/Design

can serve the same purpose for this.  Is this what you guys call
the "manifest"?


More information about the Mercurial mailing list