refactor(mutagen): one mechanism — pair on ssh, nothing on a schedule - #182
Merged
Conversation
The launchd agent recreated ~/Sync/mvrx-nolang-dev at login and every hour whether or not that machine had been touched, which is the opposite of what the directory is meant to tell you. The ssh path already covers it; the -sync alias is now looked up from ssh_config instead of being hard-coded in a peers list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
~/Sync/<host>is supposed to mean "a machine I have actually talked to". The launchd agent broke that for the one host inpeers: it ran at login and hourly, andmkdir -p'd the directory whether or not that machine had been touched — even on the many attempts where it then failed to create a session at all.Since #179 the ssh path already covers pairing, so the agent, the
peerslist and the per-peer script all go. 89 lines deleted, 27 added.The one thing
peerscarried that the ssh path did not is the-syncalias. That is now looked up rather than declared: if ssh_config defines<host>-sync, that entry is dialled, otherwise the host itself is. The convention is documented in the header instead of being encoded in a list of one.Behaviour after this:
~/Syncappears the first time you ssh to that host, and never otherwiseChecked against stub
ssh/mutagenwith a fixture ssh_config that has bothmvrx-nolang-devandmvrx-nolang-dev-sync:Note the local directory keeps the host's name in both cases; only the dial target changes.