[Unison-hackers] On making times=true the default
Dan Christensen
jdc at uwo.ca
Sun Jan 19 08:56:05 EST 2025
On Jan 16, 2025, Greg Troxel <gdt at lexort.com> wrote:
> So, I would be in favor of times=yes having automatic/silent conflict
> resolution where the newer timestamp is set to the older one, as fixing
> up past errors.
I think it would be a mistake to auto-update times to the older one. If
a timestamp has been updated, then if anything automatic happens, it
should be that the older timestamp is replaced by the newer one.
For example, make's behaviour depends on timestamps. Suppose we have
file1.c producing file1.o, with the replicas in sync (including times).
I edit file1.c and rebuild file1.o, but then realize that there's a bug.
So I revert my change to file1.c, but don't get around to running make.
Then I run unison, and the timestamp on file1.c gets set to the old
time, since the file contents match. Then I run make, and file1.o is
*not* updated, and I can't figure out why the program is still buggy.
Other software also relies on timestamps. E.g. a lock file is often
empty, but the timestamp is sometimes used to indicate whether the lock
is stale.
(I use times=yes, so this wouldn't affect me. I'm just arguing that
automatic conflict resolution to the older time is not safe and should
not be something that happens without the user selecting it and being
warned that it is not safe.)
Dan
More information about the Unison-hackers
mailing list