Skip to content

Commit

Permalink
props: Stop allowing 1-hour differences in times
Browse files Browse the repository at this point in the history
This was introduced in adf68c9 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.
  • Loading branch information
gdt committed Jun 10, 2024
1 parent b10f9dd commit 8d79fee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/props.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d79fee

Please sign in to comment.