Get a diff view of your Obsidian Sync, File Recovery and Git version history

Overview

Version History Diff (for Sync and File Recovery Core plugins and Git)

Note

This plugin uses private APIs, so it may break at any time. Use at your own risk.

Features

It can

  1. display diffs of the Sync
  2. and the File Recovery
  3. and Git version history for the currently active file,
    1. For this to work, the Obsidian Git plugin needs to be installed.
  4. open a selected version in a modal and
  5. render it as either markdown or
  6. plain text and
  7. you can overwrite the file with this version as well.
  8. There is a colour-blind mode
  9. It also adds a command to open Obsidian's native Sync history view, which is otherwise only accessible via the file menu.

The reason for showing you the note before you revert to this state is that the diffs can be misleading.

Sync Diff example

Sync Diff changes modal

Sync Diff rendered version

Sync Diff plain text version

Git Diff example with colour-blind mode

Git Diff dark mode colourblind mode deletion

Git Diff light mode colourblind mode addition

Usage

There are two columns. The chosen version on the right side should be newer than the one on the left side for the diffs to make sense.

I personally find the file recovery diffs better as they are less frequent, but the Sync diffs might be helpful as well.

For Sync, it only displays the Sync versions. For File Recovery and Git, it also shows the current state of the file from disk as latest version.

Contributing

Please open an issue before you make a PR.

Credits

All licenses and attributions can be found in the esbuild.mjs file for the code (and therefore in the main.js release), the CSS license is in src/styles.scss. Should any license/attribution be missing, please let me know, and I will look into it.

Special thanks to @SlRvb for adapting the CSS to Obsidian and making the colour-blind mode and to @Vinzent03 for creating the necessary APIs in the Obsidian Git plugin.

Comments
  • custom base path

    custom base path

    Hi

    This plugin doesn't seem to work with custom base path feature of Obsidian Git plugin. When it is set to a child folder and it is ran by Show Git Diff View command, it results in an error.

    image

    In my case, the child folder name is Subfolder and the custom base path option is set as such.

    image

    opened by cjunekim 14
  • Option to display version history from a Git repository, in addition to File Recovery and Obsidian Sync?

    Option to display version history from a Git repository, in addition to File Recovery and Obsidian Sync?

    As you mention in the README.md, the diffs produced from the File Recovery snapshots are often more helpful than the diffs produced from Obsidian Sync versions since they're less frequent. The same is true of Git commits to a larger extent, since a Git commit is only produced when the user intentionally makes one - the revision history is deliberately curated and annotated with descriptive messages, rather than automatically generated at set intervals.

    Hence it'd be really nice to see diffs and history produced by asking Git how the active file has changed! This oddly enough isn't a feature of the existing Obsidian Git plugin, despite being a common operation that you can perform using Git integration in various text editors and IDEs.

    I don't know how well it'll work on mobile, nor whether you'd need to rely on Obsidian Git being present, but it'd still be a really nice feature to have on desktop. 🐱

    opened by 00dani 13
  • Various fixes for the CSS

    Various fixes for the CSS

    more like added upon the existing css instead of properly modifying it, so it's a bit of a quick-and-dirty solution, but it improves the visuals tremendously, already. Should be integrated better with the existing css at some point in the future.

    opened by chrisgrieser 4
  • Optimize the mobile interface

    Optimize the mobile interface

    Now it can only be used on the horizontal screen on mobile devices, which is not convenient enough. Is it possible to optimize the interface of mobile devices?

    opened by rien7 1
  • use div directly

    use div directly

    https://github.com/kometenstaub/obsidian-version-history-diff/blob/d9b5f8fbe0dab345eb05c5bf43d8375dfb49b228/src/abstract_diff_view.ts#L173

    There is no need to find the div, only its index.

    opened by kometenstaub 0
  • Why 'Obsidian Git' is required?

    Why 'Obsidian Git' is required?

    Hi, thanks for creating this plugin, I love how changes are presented (left and right column for comparison).

    I am using git diff and wonder why is Obsidian Git plugin required for this one to work? Isn't it enough that there is git in the folder? I would appreciate some explanation on how this works.

    opened by gala8y 0
  • Git diff in sub-vault

    Git diff in sub-vault

    I got a vault which contains several sub-vaults. And I plan to enable git version control for that. Obsidian Git and this plugin were installed in root vault and working great. I was able to do backups and do diffs on any vault file. Now I want to do the same in the sub-vaults by installed the two plugins there. But I got mixed results there. First the diff by this plugin is failing with following error log.

    plugin:obsidian-git:30828 git obsidian error: fatal: ambiguous argument 'path/to/note.md': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'
    
    plugin:obsidian-git:23818 Uncaught (in promise) Error: fatal: ambiguous argument 'path/to/note.md': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'
    
        at Object.action (plugin:obsidian-git:23818:25)
        at PluginStore.exec (plugin:obsidian-git:23843:25)
        at eval (plugin:obsidian-git:21430:43)
        at new Promise (<anonymous>)
        at GitExecutorChain.handleTaskData (plugin:obsidian-git:21428:16)
        at GitExecutorChain.eval (plugin:obsidian-git:21412:44)
        at Generator.next (<anonymous>)
        at fulfilled (plugin:obsidian-git:20261:24)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
    action @ plugin:obsidian-git:23818
    exec @ plugin:obsidian-git:23843
    eval @ plugin:obsidian-git:21430
    handleTaskData @ plugin:obsidian-git:21428
    eval @ plugin:obsidian-git:21412
    fulfilled @ plugin:obsidian-git:20261
    processTicksAndRejections @ node:internal/process/task_queues:96
    await in processTicksAndRejections (async)
    e.open @ app.js:1
    openGitDiffModal @ plugin:obsidian-version-history-diff:452
    eval @ plugin:obsidian-version-history-diff:452
    TB @ app.js:1
    e.executeCommand @ app.js:1
    e.executeCommandById @ app.js:1
    eval @ plugin:cmdr:7
    e.handleEvent @ app.js:1
    

    On the other hand, the diff command in Git plugin worked fine.

    Please let me know if there is any workaround or fix to make it working.

    Thx

    opened by joellti 1
  • Sync history and Sync diff don't work : Cannot read properties of null (reading 'listHistory')

    Sync history and Sync diff don't work : Cannot read properties of null (reading 'listHistory')

    Hello

    Show Git Diff view for active file works well without an issue. However, Show Sync history for active file and Show Sync diff view for active file don't work at all showing an empty window. (BTW, I don't exactly know what they do actually)

    The developer's console shows the following error:

    Uncaught (in promise) TypeError: Cannot read properties of null (reading 'listHistory')
        at t.<anonymous> (app.js:1:1970557)
        at app.js:1:235078
        at Object.next (app.js:1:235183)
        at s (app.js:1:233922)
    

    Obsidian Git version : 1.28.0 Version History Diff version : 2.0.5 Obsidian App version : 0.15.9 OS : Windows 10 21H2

    opened by cjunekim 2
  • Is it possible to view sync conflict from other services?

    Is it possible to view sync conflict from other services?

    I use Syncthing to sync between devices. Is it possible to view different versions of the files? Or at least let me open two files on my own in Obsidian and diff them?

    opened by ooker777 1
  • `git obsidian error: fatal: path 'my-file-path' exists on disk, but not in '9b812828....'`

    `git obsidian error: fatal: path 'my-file-path' exists on disk, but not in '9b812828....'`

    After renaming a file with git mv, clicking on an old version for getting the file content of that version yields this error.

    I would need a way to determine what the file name was before the renaming. The git log API does not provide any info concerning this.

    Fixing this should work by refactoring the git view to not work on file contents, and instead use the hashes to get the diffs.

    cc @Vinzent03 - What is your take on that?

    bug help wanted 
    opened by kometenstaub 3
Releases(2.0.9)
Owner
null
An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!

LearnGitBranching LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose

Peter Cottle 26.4k Jan 3, 2023
A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Carlo Zottmann 6 Dec 26, 2022
History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState

History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype.

Browser State 10.8k Dec 26, 2022
This is the frontend/UI of git history analyzing tool Who Touched What

Who Touched What? This a git analysis tool for you to see how many edits were done to each file and by whom. A quick and straight forward way to track

Haoran Zhang 4 Aug 17, 2022
Generate release notes from git commit history either commit range or tag range.

Would you like to support me? Release Notes Generate release notes from git commit history either commit range or tag range. App Store Template Change

Numan 6 Oct 8, 2022
Markdown note maker (with Git sync) using Tauri.

Mediocre Markdown note maker (with Git sync) using Tauri. Screens Tech Stack Frontend Monaco Editor for the editor interface Chakra UI library Redux T

Nilay Savant 14 Dec 6, 2022
An obsidian plugin allowing you to register and view different file extensions in a modular manner.

Obsidian Custom File Extensions Plugin This is a plugin for Obsidian to allow associaton of file type extensions with different in-app views via setti

null 5 Dec 6, 2022
This tool allows you to test your chains.json file to see if your chains are available, syncing, or in sync.

Chains Tester This tool allows you to test your chains.json file to see if your chains are available, syncing, or in sync. This is an open source tool

Jorge S. Cuesta 9 Nov 4, 2022
Readavocado obsidian plugin to sync your favorite highlights.

Readavocado Sync Plugin This plugin automatically export your Readavocado highlights into your Obsidian vault. Usage Install the Readavocado Sync Plug

Sarat Limawongpranee 9 Oct 31, 2022
This is a plugin for Obsidian (https://obsidian.md). Can open document with `.html` and `.htm` file extensions.

Obsidian HTML reader Plugin This is a plugin for Obsidian (https://obsidian.md). Can open document with .html and .htm file extensions. Obsidian HTML

null 37 Dec 27, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Juan Daniel 5 Dec 15, 2022
🔐 A Privacy-first Diff tool for everyone. ✅ Your data never hits our servers.

Features ?? Privacy-first developer tool. ?? Run on your Web Browser, Your data is sent nowhere. ?? Find a Difference between two text input for Side

Proxyman 41 Dec 5, 2022
Obsidian plugin to sync Pinboard.in links to Daily Notes

Obsidian Pinboard Sync An Obsidian plugin that adds links you've saved with Pinboard to your Obsidian Daily Notes, synchronizing periodically. Why? I'

Mathew Spolin 35 Dec 1, 2022
Obsidian.md plugin to sync highlights/notes from koreader

Obsidian KOReader Plugin Sync KOReader notes in your Obsidian vault. The KOReader device must be connected to the device running obsidian to let the p

Federico Granata 24 Dec 18, 2022
File Hider - This is a plugin for Obsidian that allows hiding specific files and folders from the file explorer

File Hider - This is a plugin for Obsidian that allows hiding specific files and folders from the file explorer

Oliver 24 Dec 16, 2022
Edit JSON text in-place for a minimal diff

edit-json Edit a textual JSON (not a JavaScript object) for a minimal diff, either programatically or by applying a JSON Patch (RFC6902). When seriali

Gustaf Räntilä 4 Oct 14, 2022
StarkNet support extension for VSCode. Visualize StarkNet contracts: view storage variables, external and view functions, and events.

StarkNet Explorer extension This VSCode extension quickly shows relevant aspects of StarkNet contracts: Storage variables of the current contract, and

Crytic 6 Nov 4, 2022
A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.

Strapi Preview Button A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view. Get Started Features I

Matt Milburn 53 Dec 30, 2022
A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil ?? A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Ben Smith 21 Jun 20, 2022