Version history (git based)

Hello, I created a version history plug to navigate between git-tracked versions of a page.

Screenshots


About this plug

I tested this on SilverBullet v0.10.4 and v2, but it’s pretty new so you may find bugs.

The plugin should be safe to use since I purposely didn’t add any action or
code that could change your pages, you may find problems here but hopefully
nothing destructive.

Installation

Want to try it out? you can go to the repo.

The url for the plug is:

ghr:ivanalejandro0/silverbullet-history

Check out the SilverBullet docs on how to install it. Note that it’s different on v0.10.4 than on v2.

Caveats

  • this will only work if your space is in a git repo and only with the files you have versioned.
  • the history won’t work if you’re offline, I haven’t tested nor investigated much that use case.
  • I haven’t yet tested how this behaves with page renames. I don’t think it’ll show a good history on that use case.
  • The history shows a linear history, but git history can be like a tree, this UI is pretty simple and if you do a lot with git you may not get the best picture of the history.
  • Commits can have different authors but I’m not showing that information. I imagine most people edit their notes by themselves so showing the author information would be redundant.
11 Likes

This looks pretty cool!

1 Like

thank you! awesome - helps a lot!

1 Like

This is actually very nice!!
Only one thing I’m missing is some kind of “diff” between two versions :slight_smile:

1 Like

I use git regularly with code, so I definitely see the appeal of seeing the diff.
I think that showing some kind of diff would take the plug to a next level, but I would need to think about how the UI for diffs would look like for it to be intuitive for everyday users.
The diff would need to be text only since mixing diff with a proper page render may not be feasible.

The goal for the versions UI is for users to be able to recover old changes.
What would you expect to get from a diff?

I think that I’d like to just click through versions and see what that version changed from the previous and see how the file “evolved” over time, but kind of do that with the current UI already.
Other users may need to find the date or context for certain change and that would be better served by a git blame.

I’ll give it some time and see what people that use this for a while feel that is missing before making any substantial changes.

I’d love to be able to diff two pages, so that I can resolve conflicts better. But not sure if that fits with the purpose of this particular plug.

I have had just one simple conflict long ago so I don’t have much of an opinion here.

But yeah, I don’t think there’s a need for git or versions to diff two conflicting pages, I think that could be its own separate plugin.

The conflicting pages are a pretty good use case, but as Stan mentioned, it is not really related to the plug.

However, having a diff would make it way better to see what changed between different versions of a page coming from the git history plug.

But, to be honest, it’s not a must-have of course, but nice to have :wink:

I’ve put together a widget that lists all conflicted pages (if any), with simple links to view the diffs. When you navigate to a specific diff page, it shows the diff itself along with buttons to either delete the conflicted page or apply the diff (which replaces the original page).

I’m happy to share it if anyone is interested. Just a heads-up: since it deletes pages and can overwrite the original when applying a diff, there’s some potential risk involved if something’s not working as intended.

That said, it seems to be working quite well for me so far - haven’t run into any issues yet.

2 Likes

Sounds very interesting. I would be happy to test it :slight_smile:

1 Like

I want it !!! hahaha

1 Like