I am wondering if it can be done the way I am imagining it could work.
I tried to find a solution to something that cannot be done within Obsidian or with URL schemes (neither with the Obsidian Advanced URI plugin): make changes e.g. in specific theme settings.
I had more changes but settled on these for now, because they are easy to handle with 2 commands like that.
I have 26 different temporary vaults because Obsidian finds the entirety of my 20000 files too large and exits on me when I open e.g. Zotero or Safari.
Hence I temporarily move my subfolders up one level to figure as bone fide vaults on their own (with their own settings). I access any file (at any Heading level) in these temporary vaults with a single Shortcut.
I have made settings changes to 26 [A-Z] (sub-)vaults in Obsidian. If I wanted to undo those, I would need to write to 26 times 3-4 files in an iOS shortcut, but having the shortcut recursively search and replace data (with A-Shell) would take time on a large vault housing many many folders with their own settings.
I was thinking of just making note of the commit IDs of the commits made and using an iOS shortcut to practically switch between states to apply either set of settings.
Having looked up answers on StackOverflow, I have seen the cherry-pick command as an alternative.
How would I go about using revert and/or cherry-pick to switch between two states (e.g. as in 'day' and 'night' settings)?
Well, the problems:
- A-Shell Libgit2 doesn't recognize the command
revert; - NewTerm2 terminal (JB app) can execute
git revert <commit-with-hash-ID>(after symlinking the repo/vault), but of course, there are merge conflicts to deal with (one needs changes on particular lines to undo, then it works); - Newterm2 doesn't have Siri Shortcut support.
Here's a better idea. make use of
git stash. You can usegit stashto maintain two or more different overlays to config data in your files that you can discard as needed and recall on demand.If you are making real changes that you want stored in the same files then you will have to use
git-add -pfor interactive patch style selection of which sections you want added to the commit index. This is a commonly used practice for overriding data in config files for testing that you need to keep recalling and i do it all the time. For example I have log levels that should be set one way for production but for development i constantly want to ratchet them up i dont want to edit the file every time... i just saygit stash apply mylog( having saved them withgit stash save mylog)This is not what git cherry-pick and revert are for. they are really for if you want to commit to the history an undoing of a commit or pull in a commit from another branch to be committed.