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

Thomas Arendsen Hein thomas at intevation.de
Thu Aug 23 05:56:35 CDT 2007


* Junio C Hamano <gitster at pobox.com> [20070823 12:19]:
> 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 ;-).

Problem with this is: if contents are not modified, dirstate size or
date info will not be changed so it has to be compared again and
again (unless inotify is used)

> *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"?

manifest is (I think) git's tree object. The working directory state
is tracked in the dirstate.

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial mailing list