When syncing TW, modified date of duplicate tiddlers is updated

87 views
Skip to first unread message

talha131

unread,
Apr 6, 2019, 7:32:36 AM4/6/19
to TiddlyWiki

I have a TW running on nodejs and stored in Git. Each tiddler is a separate file.

When I have to sync another copy of the same TW, I drop the TW.html file on it. TW is smart enough to create the new tiddlers.

The tiddlers that are already present and have not changed, their modified date is updated.

How do I tell TW that if a tiddler is already present and its content has not changed then do not touch its modified date?

Or how to tell TW, when importing another wiki, do not copy the modified date?

TonyM

unread,
Apr 6, 2019, 7:51:23 PM4/6/19
to TiddlyWiki
have you tried simply turning off the timestamps option in sidebar before importing?

tony

talha131

unread,
Apr 7, 2019, 10:57:41 AM4/7/19
to TiddlyWiki

Thank you Tony. I tried disabling the timestamps but it didn’t affect the imported tiddlers.

First I disabled the timestamps. The tiddler $__config_TimestampDisable.tid' got ayes` in its body.

Then I started the import. I noticed that $__config_TimestampDisable.tid' file was also in the import list. I unchecked it so that is not imported.

Then I imported the rest of the tiddlers.

The end result was that the modified date of all the tiddlers were updated.

I think the solution is to either

  1. Disable timestamps should mean timestamps are not updated for created or modified fields when tiddlers are imported
  2. Or a better way to report duplicate tiddlers when importing a TW

Jeremy Ruston

unread,
Apr 7, 2019, 1:29:20 PM4/7/19
to tiddl...@googlegroups.com
Hi Talha

The tiddlers that are already present and have not changed, their modified date is updated.

That's right: at the moment, when using the filesystemadaptor under Node.js, modified tiddlers are re-written to disc regardless of whether their fields have actually changed. It could be fixed so that it skips writing tiddlers that haven't changed.

I think that the reason it's not been fixed is that when using Git the file modification dates are ignored, and it just looks at the file content.

Best wishes

Jeremy


How do I tell TW that if a tiddler is already present and its content has not changed then do not touch its modified date?

Or how to tell TW, when importing another wiki, do not copy the modified date?

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7ff79943-c3b4-4548-ac4a-a7c02558c83a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

talha131

unread,
Apr 8, 2019, 8:05:06 AM4/8/19
to TiddlyWiki
Thank you Jeremy.

Jed Carty

unread,
Apr 9, 2019, 4:13:39 AM4/9/19
to TiddlyWiki
For Bob I made two methods for testing if a tiddler has been updated to prevent infinite update loops when syncing. One test each field of the existing and new tiddler to determine if it should be updated and the other normalises a tiddler then uses quick hashing function and compares the hashes. I didn't think there was a general use for it in the core but if it would be useful I can make a pull request with one or both. I think that the hashing method is a better option, The benefit of the other one is that you could have a list of fields to ignore when determining if a tiddler has been updated.

And now that I typed that I realised that you could just pass that to the normalisation function and it could do the same thing.

Anyway, if this would be useful let me know. It has been tested in Bob for a few months now so I think all the big bugs have been caught.

Jeremy Ruston

unread,
Apr 9, 2019, 4:19:44 AM4/9/19
to tiddl...@googlegroups.com
Hi Jed

I don’t think it’s worth making tiddler file saving be conditional on the fields having changed unless we were also adding Bob’s ability to detect tiddler store updates made directly to the filing system. For the moment, I’m just happy that Bob makes it possible for people to experiment with that much requested feature :)

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages