Repository navigation
feat(autosync): rill autosync for hooks, GUI timers, and scheduled jobs - #103
Merged
Merged
Conversation
Adds `rill autosync <mode>`, which keeps a vault and one branch of its push remote (main by default) in step for callers that run unattended. Each run is `rill push` under a lock in .git/ shared by every caller of the clone, with the result kept in .git/rill-autosync.last. - hook-stop: Claude Code Stop hook; starts a detached background run in its own process group and returns at once; reports the previous failure once as a systemMessage; background pushes stay >=10s apart (delayed, never dropped) - hook-start: SessionStart hook; runs and waits - run/check/status [--json]: for a GUI timer and manual use; check is one ls-remote plus local status, nothing fetched - pause/resume: hold runs while the calling process lives - skips off the sync branch unless RILL_PUSH_BRANCH is set; RILL_AUTOSYNC=0 turns hooks off; CLAUDE_CODE_REMOTE=true defaults RILL_PUSH_BRANCH Writer resolution moves to a shared _rill_writer helper. New test test/cli/test-autosync.sh (32 assertions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…keover, push as own process, named sync branch, JSON control chars, interval under lock); Claude-Session trailer for cloud commits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ranch setting, no drop on lock timeout, per-process pauses, pipefail audit, PII allowlist) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no SIGPIPE in failure report, capped JSON message, unpushed without tracking ref, absolute RILL_HOME) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
rill autosync <mode>so Claude Code hooks, a GUI timer, and scheduled jobs can keep a vault and its remotemainin step without racing each other.hook-stop/hook-startfor the Stop and SessionStart hooks (background run with failure reporting viasystemMessage; waiting run at session start)run/check/statuswith--jsonfor GUI use;checkis onels-remoteplus local status.git/for every caller, stale-lock takeover, a 10s minimum gap between background pushes (delayed, never dropped),pause/resumefor jobs that push once at the endRILL_PUSH_BRANCHis set;CLAUDE_CODE_REMOTE=truedefaults it for cloud sessionsrill syncis already the plugin adapter command, hence the new name.Tests:
test/cli/test-autosync.sh(32/32),test-push-rebase.sh(51/51),test-cli-smoke.sh(50/50), PII and CJK guards clean, shellcheck clean at warning.🤖 Generated with Claude Code