jj-autosync daemon to auto-sync a repos across dev machines #45
Replies: 3 comments 2 replies
-
Interesting idea. My first thought was that you could just use rsync, but I suppose you also want versioning? Will you sometimes be making explicit commits too (not just relying on automatic committing of the working copy)? I have thought about how to use jj with Google's internal distributed file system 1. I suspect the user-visible behavior you have in mind is similar to what I had imagined for that. What I had imagined was that the user would be able to work on any machine and any changes to the repo and the working copy would be reflected on all machines (after some replication delay, of course). Concurrent modifications (i.e. modifications within the replication delay) would result in divergent commits (i.e. two commits with the same change ID) instead of changes being lost. That would depend on the working copy getting automatically committed, of course, which would happens when you run a jj command but could also be done by a file-system watcher. I suppose the replication delay might be larger in your setup but otherwise it could probably behave the way I described here. Does that make sense to you? I think the work I'm currently doing for automatic syncing with git and for supporting multiple working copies would both provide some useful building blocks. jj currently doesn't have any native wire protocol and exchanging over the git protocol loses some information (in particular the change ID and anonymous heads). It will take a looong time before we have native wire protocol support (probably not until someone other than me invests time in it). However, jj's file formats are designed to work on a distributed file system, so you should be able to just rsync the who Footnotes
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the, again, very helpful, detailed reply @martinvonz! Regarding, rsync, yeah -- I'm pretty naively using SyncThing right now:
It's been working completely fine, I'm blessed with fast internet and there's only one of me so there aren't really conflicts. However, it feels a bit of a large, blunt hammer, when at the core what I care about comes down to SCM primitives. I don't know Google's FS, but I do think/get the impression that my dream model has been inspired by things I've heard of some google dev envs over time. And what you describe pretty accurately captures what I've thought about, and then what I haven't known to think about. For example, it hadn't occurred to me that
Maybe it doesn't matter, but I'm not sure that I follow - is this just because something like running |
Beta Was this translation helpful? Give feedback.
-
With this information, it seems that maybe there isn't really too much of a need for a tool to be "integrated" with
And then initial and periodic sync could just be some form of I think my original goal was to avoid "dumb" syncing and use the wire protocol where possible. Rather than syncing Hm, I probably should experiment and think more -- if things diverge on two machines, I should experiment more so I can understand more and then revisit this. And/or let me know if you have some other ideas about achieving the descried sort of UX with fully-OSS solutions. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I saw another user make a casual reference to auto-syncing or some sort of auto-fast-forward functionality and I've been thinking about writing this post ever since. After a small data-blip incident today and re-evaluating my current data/code syncing strategy, I decided to loop back here again and ask about this.
Given that
jj
auto-commits/tracks my working copy, I keep thinking about how this could be leveraged to provide an auto-sync functionality, at least across a set of machines for maybe a single developer.In my scenario, I'd be pairing configuring and running the service via NixOS, giving me the final goal of being able to write a manifest file that a theoretical jj-powered daemon would consume and use to know what repos to clone, and manage auto-fast-forwarding for me.
Is this something someone has given much thought to? Is it something others are interested in ... using? building? etc?
Beta Was this translation helpful? Give feedback.
All reactions