(no title)
unqueued | 1 year ago
If anyone is interested, I wrote a more generalized tool for storing metadata called storetouch[1] which takes a snapshot of file's mtimes, and stores them in a nicely formatted file for convenient restoration. You can run it's output by itself with bash, or easily parse it's output.
I found that the commit or author date's did not always make sense to represent the true age of a file. Especially for non-source-code documents. For example, a repo of scanned documents. Or a git-annex repo of podcasts going back 20 years.
Instead, I treat the commit date as the commit date, and I have a versioned sidecar that stores the actual original mtimes of the files.
It can also handle all valid POSIX filenames (a surprising amount of utilities don't, including tools like git-restore-mtime, last time I checked). If you're already using a tool like git-annex or datalad though, they have the ability to store metadata for each file as well.
I would also suggest checking out git-store-meta[2] which was the original inspiration. It stores more than just mtime, but it is more closely tied to git.
Ferret7446|1 year ago
didntcheck|1 year ago
unqueued|1 year ago
IMO mtime the de-facto file timetsamp metadata, since it is most widely supported. The other file timestamp metadata I found were not as useful or portable.
And people use git for storing more than just source code.
I personally find it very useful to be able to clone my podcast index and have accurate timestamps not just from the commit, but from the file itself.
Timestamps can be important for a collections of files, but they are fragile and often an afterthought.