Small Tip: simple no-plugin/no-core-modification way to store tiddler revisions

165 views
Skip to first unread message

Diego Mesa

unread,
Feb 27, 2018, 1:19:34 PM2/27/18
to TiddlyWiki
Ive always wanted a plugin to store tiddler revisions. A simple way I do this now which might be obvious to some, especially in retrospect is to just clone a tiddler, keep the original title and add "/r1" after the original title and save it. An example:

My Tiddler           ----> always represents the latest/current version of the tiddler
...
My Tiddler/r3       ----> nex next oldest
My Tiddler/r2       ----> next oldest
My Tiddler/r1       ----> oldest version

Now, if you want to see the revisions of a tiddler you can use:

<<tree prefix:"My Tiddler">>

NOTE: This is a simple tip using no modifications to core or plugins to accomplish. It has several downsides, and some ways to ameliorate them (at added complexity/overhead)
  • you're making many copies of the tiddler, which could blow up in size - this is NOT a memory efficient revision mechanism
    • this could be addressed by storing just a diff, perhaps generated by the new diff mechanism core will hopefully get soon!
  • you have to manually keep track of revision names/numbers
    • this could be addressed with a simple "new revision button" to do the counting, which could be added to either view mode or edit mode or both.
  • you have to manually put the tree somewhere to take a structured look
    • this could be addressed with a simple "revisions" pane in the info pane of tiddlers which contians this tree
  • naming scheme is not that informative
    • this could be addressed simply by altering the scheme to store a message in the the title: "/r1" to "/r1 - changing the layout", or a better way is to store a message in a field and have that displayed in the "Revisions pane" mentioned earlier. 

I share here because even this simple way to store revesions has come in handy for my simple use cases.


Diego

@TiddlyTweeter

unread,
Feb 27, 2018, 1:37:58 PM2/27/18
to TiddlyWiki
Two thoughts ...

1 - Add an "archive save" button that clones the tiddler and increments the save number automatically.

2 - Using the Bundler plugin to  easily periodically archive. Use its "filter" mode to automatically isolate all but only the items you need to archive so you can free up space in the TW.

The idea is a very good one. Recent innovations like that discussed at https://groups.google.com/d/msg/tiddlywiki/fxLtI4igpfY/kru1ES3LBgAJ are down this line of thought--though with more concentration on live editing comparison old-to-new. Does it already do what you are thinking?

Best wishes
Josiah

Diego Mesa

unread,
Feb 27, 2018, 2:14:32 PM2/27/18
to TiddlyWiki
I should also note that Danielo's NoteSelf:

https://noteself.github.io/

has tiddler revisions built in.

Diego Mesa

unread,
Feb 27, 2018, 2:22:16 PM2/27/18
to TiddlyWiki
Hey Josiah,

I like your ideas. For #1, I also thought a "new tiddler revision" button could easily accomplish this part. For #2 - I really like the idea of incorporating the bundler plugin! I'd like to pause for a second and emphasize:

This is bascically like the  "staging area" in a git-based version control system!!

Some examplanation: In a git repository, you add files to the "staging area", letting git know that these are the files and versions of those files you would like it to remember, and then you actually commit those files in the staging area. Thats how you keep track of versions. With this, the bundler could use filters to grab different groups of files, check if theyve changed (perhaps checking if modified is different than a last_modfified field which could be set by the revision saving mechanism) and then save them. In the analogy the bundler's filter acts as the staging area, only grabbing the tiddlers you care about, and the revision saving mechansism acts as the git commit.

Just some thoughts

Diego

TonyM

unread,
Feb 28, 2018, 5:58:16 AM2/28/18
to TiddlyWiki
Diego,

Thanks for sharing, I made an unpublished tiddler backup plugin with a tool bar item to do something similar, however it would also be good to remove tags at the sametime, especialy for macros and style sheets but for most tag use cases as well.

I also plan to save the backup tiddler as $:\backups\tiddlername\increment to hide from searches and have a quick way to remove all backups in one tree delete.

Regards
Tony

wjam

unread,
Mar 1, 2018, 7:17:53 AM3/1/18
to TiddlyWiki
See also
$://plugins/wjam/save button ...
twjam5beta
can be used stand alone. no js required
wjam
Reply all
Reply to author
Forward
0 new messages