From 7292804c1bafd43389defc0d7b4352ada666d626 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Wed, 18 May 2022 16:35:35 +0100 Subject: Add ability to not save mtime in metadata files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you're storing metadata in a version control system with multiple branches, mtime differences are going to produce a whole bunch of conflicts that you likely don't care about. This allows you to not save mtime and avoid those. Note that we use a sentinel value of -1 for the mentry `mtimensec` field to indicate this in the data, as all values of `mtime` are theoretically valid, but `mtimensec` must always be between 0 and 999,999,999 in the real world. I'm not 100% sure about the mechanism for selecting this feature. The legacy behaviour for metastore was to save mtimes in the metadata files, but ignore them for compare/apply by default, with a `--mtime` option to use the mtime data. Keeping the legacy behaviour for backwards compatibility, but adding a `--no-mtime` option to ignore mtimes when saving felt like a reasonable way of making this happen, but something about it doesn't feel great. Maybe I just didn't figure out how to make the documentation clear enough. ¯\_(ツ)_/¯ --- man1/metastore.1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'man1') diff --git a/man1/metastore.1 b/man1/metastore.1 index 1e01daf..ee01dd8 100644 --- a/man1/metastore.1 +++ b/man1/metastore.1 @@ -51,6 +51,9 @@ once for even less verbosity. .B \-m, \-\-mtime Causes metastore to also take mtime into account for the compare or apply actions. .TP +.B \-M, \-\-no\-mtime +Causes metastore to not save mtime in the metadata +.TP .B \-e, \-\-empty\-dirs Also attempts to recreate missing empty directories. May be useful where empty directories are not tracked (e.g. by git or cvs). @@ -108,7 +111,7 @@ in and .I mtime is the ISO-8601 extended format representation of the last-modified time in UTC, -with nanosecond precision. +with nanosecond precision, or a literal "0" if mtime is not saved. Strings are URL-encoded, and all characters from 0x00 to 0x20 (inclusive), 0x25 (%) and 0x7F \fBmust\fR be encoded. -- cgit v1.2.1