I’m a big fan of atuin but have made little use of the sync features. Especially in a corporate/work context, it’s really hard to bring myself to interface my shell history with some random external server – even if I know the keys are held locally and the server can’t see any of it.
I end up using git annex for a lot of other things (both in the context of work and in my personal computing), and I was wondering if anyone has ever proposed an integration on that axis. As of today, there’s nothing stopping anyone from just putting the sqlite database from each host in its own unique file and managing it with git-annex as-is, but you lose out on the ability to mix-and-match shell history from multiple hosts.
I recently came across the concept of a git merge-driver, and I’m wondering whether this can’t be an escape hatch for people like me who want to be able to use atuin in a mesh setup. My understanding is that if you register a merge driver in git config, and map the file to the driver in .gitattributes
, you can get git to dispatch to that binary whenever there are conflicts. For a sqlite database, I’d expect that to occur in 100% of cases.
links:
- Main git docs: Git - gitattributes Documentation
I started stubbing something out here but I’m realizing I need some input before I go any further.
-
am I even understanding this correctly? The gitattributes man page describes a similar notion of a filter driver that is called on each checkin/checkout of a file, and it’s not totally clear where the overlap is (if any).
-
are there any big blockers you’d expect this to hit, or work that should be done to make this easier?
-
eg: There’s a comment at the top of the sqllite impl suggesting there might have been plans at one point to avoid putting all entries in a single table. Is that still desired? Can we divide the sqlite tables by host, rather than having the same table name on each host? Would that make anything easier?
-
any special considerations I need to take around
deleted_at
? or migrations? -
What would an
atuin import atuin
backend look like – can it just concatenate rows from both tables without concern? Would it be better to just implement that interface, and then implement the merge driver in terms of that interface, avoiding the need for git awareness in atuin completely?
any other hints or ideas or input appreciated!