git-annex/doc/bugs/proposal_for_timestamp_semantics.mdwn
2023-09-22 15:38:58 -04:00

13 lines
1.2 KiB
Markdown

# High level overview:
* This only concerns mtime (and its equivalents on other systems, if applicable). atime, ctime and permissions are out of scope.
* An object added to an annex and later retrieved from it via `mv`, `cp -L`, `git annex unannex` and such should always keep its mtime, even if retrieved on an entirely different machine and/or from a backend that doesn't support timestamps natively.
* If an added/reinjected object is already known to the annex, use the older mtime by default, since that's probably the version that's had its metadata preserved better.
* If that's too much of an assumption, provide a switch to use the older/newer/known/unknown mtime, or add a git-annex-touch command.
* symlink and object file mtimes should reflect the mtime tracked by the annex.
* ideally, directory mtimes would also be preserved, or failing that, `git-annex-fix`, `git-annex-add` and `git-checkout` should leave them untouched.
# open questions/ideas:
* What if the user `touch`es a file/symlink, bypassing git-annex? Should the data be reconciled or ignored?
* preserving directory mtimes looks tricky, but could it maybe be done from a hook or two?
> [[notabug|done]] --[[Joey]]