From 8d79feeaf8accec097fe04fe5ac6650f79c78ade Mon Sep 17 00:00:00 2001 From: Greg Troxel Date: Mon, 10 Jun 2024 09:10:11 -0400 Subject: [PATCH] props: Stop allowing 1-hour differences in times This was introduced in adf68c98d042bcc484fbd2e5dfbdc97ca2ef1881 in 2009. The theory is that on Windows with FAT, filesystem times are in an undetermined timezone (a design defect) and as DST happens, the times of files already there change. While this is true, ignoring an hour change also ignores valid changes on filesystems that store times correctly (in UTC, as the major example). Ignoring an hour is not enough; if the host's timezone changes by 3 hours (or anything not 1), then times in FAT move by that amount. It's also too much, in that the workaround ignores time changes on filesystems with a stable time representation. Therefore, remove the workaround, and anyone who is using FAT, changing timezones, and syncing times (expected to be very few) can propose how to deal with this in a way that doesn't adversely affect others. Fixes #72. --- src/props.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/props.ml b/src/props.ml index 651865114..73d74facc 100644 --- a/src/props.ml +++ b/src/props.ml @@ -478,9 +478,9 @@ let extract t = match t with Synced v -> v | NotSynced v -> v let minus_two = Int64.of_int (-2) let approximate t = Int64.logand (Int64.of_float t) minus_two -(* Accept one hour differences and one second differences *) +(* Set up for ignoring 1s differences in function similar, below *) let possible_deltas = - [ -3601L; 3601L; -3600L; 3600L; -3599L; 3599L; -1L; 1L; 0L ] + [ -1L; 1L; 0L ] let hash t h = Uutil.hash2