Skip to content

v1.3.5-1-g74adbbc-dirty

Compare
Choose a tag to compare
@stephenh stephenh released this 05 Jan 21:35
· 19 commits to master since this release
Better handling of directory mod times.

Mirror is fundamentally based on mod times, i.e. latest mod time wins.

This works great for files, but directories are a bit different, because
any new/changed file in a directory, updates the directory's own mod
time to an OS-generated value.

In general we don't want to bother with keeping these in-sync across
local/remote, so now we explicitly ignore this case.

Deletions also don't work well with mod times, b/c a deletion doesn't
really have a time in the file system anymore; previously we added the
old mod time + 1 second immediately when the delete happened, but this
could result in an ignored write, hwen our "now + 1 second" hueristic
was artificially ahead of an actual now + < 1 second write on the
just-deleted file.

We still need to fudge with mod times on "deleted then restored via
mv" files, to ensure their still-in-the-past-b/c-it-was-restored mod
time "wins" over the deletion mark, so we recognize when that is
happening and bump the restored file's mod time ahead by 1 second.