[plugin] My simple tiddler version control

353 views
Skip to first unread message

Mal

unread,
Jan 30, 2019, 2:46:08 AM1/30/19
to TiddlyWiki
All,

For information, I've put together a simple system for managing saved versions of tiddlers.  You can try it out or install the plugin from my tiddlyspot site.

When I am setting up a tiddlywiki for a particular purpose, I usually end up with various customisation tiddlers with stylesheets, macros, variations to the table of content macros, etc.  For this activity, I prefer to work in the tiddlywiki environment rather than setting up github/git/external editor workflows.

This simple version control system allows me to commit changes to individual tiddlers as required and then to restore previous versions if needed.  Along with the Tinka plugin, this gives my a good development environment for simple projects.

My plugin is inspired by and uses some code from JD's Plainrevs plugin with a number of simplifications.  The main features are:
  • The code for the plugin resides in a single wikitext tiddler.
  • The version control functionality does not interfere with the normal operation of a tiddlywiki and is contained in the "Versions" tab in the tiddler Info panel.
  • Committed versions of any tiddler can be saved at any time along with a simple commit message.
  • There is no automatic saving of versions during the edit process.
  • Committed versions can be restored to replace the current version of the subject tiddler.
  • Committed versions can be deleted.
  • Committed versions are saved as system tiddlers so that they do not show up in normal searches.
  • Incremental differences between each version and the next previous version can be displayed.
  • There is no set limit on the number of versions retained.
Any feedback or suggestions are welcome.

Regards,

Mal

Thomas Elmiger

unread,
Jan 30, 2019, 3:00:03 AM1/30/19
to TiddlyWiki
Hey Mal,

Sounds cool, Your process is similar to mine, so I will have to try this.

Cheers,
Thomas

TonyM

unread,
Jan 30, 2019, 3:25:45 AM1/30/19
to TiddlyWiki
Thanks for sharing Mal,

Sounds like something I need.

Will review soon

Tony

Mal

unread,
Jan 30, 2019, 6:12:54 AM1/30/19
to TiddlyWiki
By the way, I should have added the usual disclaimer that this has not been thoroughly tested, so take care, backup, etc.

Mal

@TiddlyTweeter

unread,
Feb 3, 2019, 7:15:34 AM2/3/19
to tiddl...@googlegroups.com
Hi Mal

This is really good. I find it easy to use and the logic of it makes more sense to me than versioning tools I've tried (the 3 others I know of). I'm using it on a test TW with intent to use it seriously.

I think there is a BUG ... I can replicate it like this ...

1 -- Create tiddler and enter the text:  [[test]] . Save. Then Info, press Commit.

2 -- Edit tiddler, removing the brackets, so the text is:   test  . Save. Then Info, press Commit.

3 -- Still in Info. Click to restore item (1).

4 -- Click item (0) and you'll see an (illegal) field has been created with a message about a missing bracket ... Here is a screenshot ...

Capture.PNG


I also have two other SUGGESTIONS ...

A -- That in addition to the [Commit] button in the Info Panel there is also a Commit [Icon] available next to the Save tick icon when the editor is open.
The function of this: to do a Commit but leave the editor OPEN.

The reason I ask is that in situations where I am constantly revising I need frequent snapshots and having to Save -> Info -> Commit -> Reopen is distracting.

Just a thought ...

B -- Could you give some info on how the user could increase the height of the box in the Info panel where you view the tiddler differences?

The reason is simply to be able to see longer tiddlers with minimal need to scroll.

Best wishes
Josiah 

JD

unread,
Feb 3, 2019, 7:50:52 AM2/3/19
to TiddlyWiki
Hi Mal,

Thanks for the acknowledgement! Your additions and simplifications are stuff I would like to use myself (especially the commit message). I also love plugins that have so few tiddlers in them!  

Speaking of that commit message, I'm always bothered by input elements referencing missing tiddlers. They show the placeholder: "type the text for the tiddler 'Missing tiddler'"

Could you add something like this to the input element? <$input default="" placeholder="Add note"> or "..." or "Enter commit message" or something? Small details like this really make an interface feel nice.

-jd

@TiddlyTweeter

unread,
Feb 3, 2019, 7:58:08 AM2/3/19
to TiddlyWiki
For readers on email ...

... the image in my last post documenting a bug did not work ... I edited the post and now its displaying correctly. J.

Mal

unread,
Feb 4, 2019, 12:15:07 AM2/4/19
to TiddlyWiki
Josiah,

Thanks for the positive comments.

I think there is a BUG ... I can replicate it like this ...

You are right, there is a bug in the field restore button logic.  I am working on a fix and will upload a new version of the plugin soon.

I also have two other SUGGESTIONS ...

A -- That in addition to the [Commit] button in the Info Panel there is also a Commit [Icon] available next to the Save tick icon when the editor is open.
The function of this: to do a Commit but leave the editor OPEN.

This is a bit complicated.  The issue is that in edit mode you are actually editing a draft tiddler that is not saved to the actual tiddler until the save button is clicked, so I'm not sure how it would be possible to save a new version in edit mode.  I too would like to have the ability to save and continue editing - any suggestions would be welcome.

By the way, when I am customising, I usually set the info button to be displayed on the vew toolbar and turn off automatic closing of the info panel (Control Panel / Settings / Tiddler Info Panel Mode).  At least this keeps the info panel visible.

B -- Could you give some info on how the user could increase the height of the box in the Info panel where you view the tiddler differences?

I'll need to investigate this.

Regards,

Mal

Mal

unread,
Feb 4, 2019, 12:18:38 AM2/4/19
to TiddlyWiki
JD,

Thanks for the feedback.

Speaking of that commit message, I'm always bothered by input elements referencing missing tiddlers. They show the placeholder: "type the text for the tiddler 'Missing tiddler'"

Could you add something like this to the input element? <$input default="" placeholder="Add note"> or "..." or "Enter commit message" or something? Small details like this really make an interface feel nice.

I had actually made this change to my local copy and will update the plugin soon.

Regards,

Mal

Mal

unread,
Feb 4, 2019, 3:48:28 AM2/4/19
to tiddl...@googlegroups.com
All,

I've updated the version of this plugin on my Tiddlyspot site.

It fixes the field restore bug reported by Josiah and adds a commit message placeholder, as mentioned by JD.

Note that this is still experimental, so use with care and let me know of any issues.

Regards,

Mal

Thomas Elmiger

unread,
Feb 4, 2019, 11:57:14 AM2/4/19
to TiddlyWiki
Hi Mal,

Regarding save without closing: I have a plugin here that works around this via save and reopen:

https://tid.li/tw5/plugins.html#%24%3A%2Fplugins%2Ftelmiger%2FEditButtons

Feel free to copy from it!

Good luck!
Thomas

Mal

unread,
Feb 4, 2019, 10:04:44 PM2/4/19
to TiddlyWiki
Thanks Thomas. I'll check it out.

Regards,

Mal

Mal

unread,
Feb 5, 2019, 2:11:49 AM2/5/19
to TiddlyWiki
I've had a look at Thomas's EditButtons plugin and it clearly provides a useful addition to my development workflow, in particular the button to save and keep editing.  I am often making small changes and wanting see their effect before I save and close the editor.  Obviously, the preview pane is not much use for this when developing macros, stylesheets, etc.

However, I am not sure about implementing a button to save, commit a new version, and keep editing, as suggested by Josiah.  This would need a commit message text box added to the edit view and then an edit view toolbar button that saves, commits and keeps open in edit mode.  All this is possible, but does add some complexity.  Given that I tend to go through a fair number of edit-test cycles before I commit a new version, I'm not sure of the added benefit.

In any case, I will keep this option in mind after I've made a couple of other improvements that I have on the list.

Regards,

Mal



Vinayak

unread,
Feb 5, 2019, 7:08:22 AM2/5/19
to TiddlyWiki
Great

I have started using it and looks good. The user interface looks difficult to understand initially. 

Just the feature I was looking for. Fully servers the purpose of tracking old versions if there is any issue. 
As the DIFF is readily available it saves time to quickly check what has changed.

Thanks & Regards
Vinayak Shanbhag

Dave Gifford - http://www.giffmex.org/

unread,
Feb 5, 2019, 10:08:38 AM2/5/19
to TiddlyWiki
Hi Mal

I added this to the toolmap in the Saving tools category. (https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM)

The incremental load was already in the toolmap, but I added it to another section, the one for node.js.

Someone probably already beat me to the punch on this, but just in case...so...are these plugins considered "Mal"ware? yuk yuk

Dave

TonyM

unread,
Feb 5, 2019, 8:10:37 PM2/5/19
to TiddlyWiki
Never thought I would say there is some "malWare" I like :) very funny Dave

Mal

unread,
Feb 6, 2019, 1:06:19 AM2/6/19
to TiddlyWiki
Thanks Dave.

And, no, your the first, but probably not the last with the "Mal"ware quip. 😊

Regards,

Mal

Dave Gifford

unread,
Feb 6, 2019, 7:20:48 AM2/6/19
to tiddl...@googlegroups.com
Cool! Blessings to you

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/J-eYE8N68lE/unsubscribe.
To unsubscribe from this group and all its topics, 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/463f47aa-3f21-4aaf-aa7b-f3e3f91df681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mal

unread,
Feb 8, 2019, 12:36:39 AM2/8/19
to TiddlyWiki
All,

For information, I've uploaded a new version with a few fixes:

* Hide Restore and Delete buttons when current version selected
* Fix error with display of field diffs
* During version restore, remove fields from current version not present in restored version
* Added warning to readme tiddler
* Added History tiddler

Regards,

Mal

barro...@gmail.com

unread,
Feb 10, 2019, 3:41:27 AM2/10/19
to tiddl...@googlegroups.com
I'll have some of that "Mal"ware :)  Good thing Dave got it into the Toolmap for when I have the time to look at it-- a versioning tool will be essential to the custom TW's I make.

Mal

unread,
Feb 11, 2019, 3:06:36 AM2/11/19
to tiddl...@googlegroups.com
All,

I've uploaded another version of this plugin to my Tiddlyspot site.

It includes some updated styling for the Commit Message text box.

Regards,

Mal




@TiddlyTweeter

unread,
Feb 11, 2019, 5:17:52 AM2/11/19
to tiddl...@googlegroups.com
Hi Mal

Great tool. Works really well!

I note your earlier comments about complexity of a Commit when editor is open.

I am now thinking that the "open for Edit" button might be modified so that a Tiddler, say, tagged "WIP" made a Commit before the editor is opened? Not expecting you to do it. Just wondering if the "Commit" part might be possible to use that way?

Very best wishes
Josiah
Reply all
Reply to author
Forward
0 new messages