File dates and Git
Compression, decompression, rollback and crash recovery keep four dates exactly, to the nanosecond.
The four dates that stay
| Date | Where you see it |
|---|---|
| Birth (created) | Finder, Get Info |
| Date added | Finder, the Date Added column |
| Modified | Finder, ls -l, builds, backups |
| Accessed | ls -lu |
Coldpack captures them before the operation, stores them in the journal entry, and sets them again with setattrlist after the final write. A test sets four distinct old dates and fails if any of them changes at any step.
The one that cannot stay: change time
The inode change time (ctime) cannot be set from user space. Every operation moves it. This is true of every program that changes a file, not only Coldpack.
What it means for Git
After Coldpack compresses a file, Git sees a different ctime. On the next git status it reads the file once, finds the same content, and reports the file as clean. The cost is one extra read of that file. This is covered by a test.
To avoid even that read, tell Git to ignore the change time:
git config core.trustctime false
What it means for programs
The change time is also why Coldpack never touches programs: macOS refuses to start a new instance of a signed program whose change time moved. See Safety and recovery.