atuin
atuin copied to clipboard
Feature request: sync config
It would be neat if the config.toml
could be synced using the sync server. As it stands, I'm manually copying the same file to different hosts.
Now that v18 is out with a new sync (opt in), I'd like to look at implementing this. Will have a few config-related experiments out in the next few releases
I was thinking of this and how it would interact with my workflow. I like the idea of being able to sync the config but worry that this might lead to unexpected behaviour as if this is on by default ppl who WANT machine specific behaviour might be surprised. Might not be a big issues just something that came to mind when I thought about this feature. Maybe it could be added as a prompt as part of the login so ppl have to opt in.
by default ppl who WANT machine specific behaviour might be surprised
So currently the sync build will prefer newer records, for all data structures we are syncing so far. For example
host X sets A=1 at T=0 host Y sets A=2 at T=1
If both X and Y are fully synced, then A=2 across the board. This is used for the KV, history deletes, aliases, etc.
For synced config, we could resolve conflicts differently. Perhaps like so
host X sets A=1 at T=0 host Y sets A=2 at T=1 host Y sets B=3 at T=2
Observed from X, A=1 Observed from Y, A=2 Obserbed from {X, Y}, B=3
Ie, hosts show a preference for their own data, but in absence of that will accept data from any host.
We'd probably want more flexibility than that, but it could make sense as a starting point.
I think I understand but to ensure I'm not misunderstanding let me try to rephrase in my own words. If not set previously on this host use the synced value. If set use the value set on this host.
If that is correct the problem I see is that next year I'll have forgotten what I set where. And I'll try to set something for everywhere say A from host X and it will not get updated on host Y and I won't know why.
Unfortunately I don't have any ideas yet about how it should work only noticing the problem that I see with the current approach. Hopefully I'll keep thinking about it and might get an idea that will help. Will try to report back if I come up with something other than a UI for config syncing. Naively, without having given it much thought yet. I've only ever found syncing when I don't always want the newest version for some reason to work with a UI where I can see what is different and choose what action to take. For example how it is done in FreeFileSync (which I use for the "manual" backups on my laptop) where it shows each of the differences and what it plans to do and lets you choose if you want to leave the default (which for this case could be take newest) or change to reverse the decision or not sync that particular item.