[Unison-hackers] On making times=true the default

Dan Christensen jdc at uwo.ca
Mon Jan 20 09:01:45 EST 2025


If the proposed propagation of older timestamps to newer ones is not
automatic and silent, then the discussion in this thread is not very
important.  I'm just replying to Michael to clarify some things:

On Jan 19, 2025, Michael von Glasow <michael at vonglasow.com> wrote:

> On 19/01/2025 15:56, Dan Christensen wrote:
>
>> 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.
> 
> IMHO that would be a rather exotic use case for Unison. Standard
> procedure is to use version control. When reverting to an earlier
> version, the VCS should set the timestamp to when the file was reverted,
> not when it was first created in this version – I’m fairly sure this is
> what Git and others do.

I wasn't proposing that unison be used for version control.  The
"revert" step above would be done either manually or using a VCS.  Then
between the revert step and running make, unison is run.  If unison has
automatic and silent updating of timestamps, then the new timestamp on
the reverted file could be replaced with an old timestamp, breaking the
behaviour of make.

However, as pointed out elsewhere in the thread, this wouldn't be
considered a conflict in the scenario above, so this automatic behaviour
shouldn't kick in.

>> 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.
>
> If you actually have a use case for syncing lock files

I don't intentionally sync them, but I sync a large portion of my
home directory, and programs create lock files in various places
with various names, so it's inevitable that some get synced.

Dan



More information about the Unison-hackers mailing list