Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [jgit-dev] DirCacheEntry.mightBeRacilyClean correct?

Thanks for your detailed explanation!

Now I doubt if we implemented the AddCommand right in,1036.

We create a new index in memory using the DirCacheBuilder. For a changed file
we set entry.setLastModified(f.getEntryLastModified());
f.getEntryLastModified() returns the new lastModified() of the file.

Now, when we call builder.commit(), the DirCache.write() method
eventually calls mightBeRacilyClean() on the entry with the
new timestamp (mtime), which is always > smudge_s.

You stated the following:

> When you edit a file with your editor, and we later refresh the
> index, *if the content differs*, we don't update the index timestamp
> to the new lastModified() of the file.  We leave it alone.
> The only way that smudge_s < mtime can be true is if we are seeing
> some funny clock skew due to an NFS environment, or if there
> are different cores reporting slightly different times, or if we
> have had to smudge this record before.  (The way we smudge is by
> setting the time far into the future, causing the record to report
> mightBeRacilyClean again.)

So it seems that we are doing something wrong in using the DirCacheBuilder.


Back to the top