devshell: Fix ssh-machine caching in jj workspaces
CI / Check, build and cache nixfiles (push) Successful in 48m33s
Update docs / update (push) Successful in 1m15s

This commit is contained in:
2026-11-18 21:08:24 +00:00
parent fc92ff9ba1
commit 4307939aab
4 changed files with 20 additions and 13 deletions
+6 -5
View File
@@ -60,11 +60,12 @@ Generated profiles deploy in this order:
`ssh-machine <name> [cmd]` resolves `user@host` and the merged global/node `sshOpts` from
`.#deploy`, using the same `my.deploy.enable` gate and `@` → `-at-` mangling as `deploy`, then runs
`ssh`. Connection settings for all nodes are cached together in `.cache/ssh-machine/`;
normal connections read the cache without running Nix. A fingerprint of Git HEAD and
staged/unstaged tracked changes automatically invalidates it, including newly added files
after `git add`.
Untracked and ignored files do not affect the fingerprint. Any tracked edit, even an unrelated
one, causes the next connection to refresh all nodes. Use `ssh-machine --refresh` to force a
normal connections read the cache without running Nix. A fingerprint of the checkout
automatically invalidates it. In a Jujutsu workspace (including secondary workspaces without a
Git checkout) it is the working-copy commit ID, so any snapshotted change counts, including new
files that are not ignored. In a Git-only checkout it is HEAD plus staged/unstaged tracked
changes; untracked files only count after `git add`. Ignored files never affect the fingerprint.
Any such edit, even an unrelated one, causes the next connection to refresh all nodes. Use `ssh-machine --refresh` to force a
refresh, or `ssh-machine --refresh <name> [cmd]` to refresh and connect. Refresh failures stop
the command; the previous cache is never used as a fallback.