Repository navigation
Conversation
…nd run it only when asked
Owner
Author
|
@claude review it |
|
Claude finished @landsman's task in 35s —— View job Review of #380: auto-pull
VerdictThis looks good to merge. I found no correctness bugs.
Things worth a look (none blocking)
Not verifiedI did not exercise |
…d keep same-second saves apart
Owner
Author
|
Thanks. Per point:
|
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.
Every 5 minutes,
bin/git/auto-pull.shfetches each repo inbin/git/auto-pull.confand fast-forwards it to its upstream.make git-auto-pullsays whether it runs and, on ay, links the job in (a LaunchAgent on macOS, a systemd user timer on Linux) or removes it, a reboot included. It turns on only from~/projects/landsman/config, the path the job runs. The job files sit inbin/git/, not in a stow package: launchd loads every plist in~/Library/LaunchAgentsat login, so a stowed one would run on a new Mac before anyone asked for it.When the remote did not move, nothing is touched. When it did, local changes the update does not reach stay in place. A change in the way is saved as a stash commit under
refs/auto-pull/and then reset, never on the stash stack, which every worktree shares. Recover one withgit for-each-ref refs/auto-pull, thengit stash apply <ref>.Git's own fast-forward decides what an untracked file blocks. A hand-written check before it missed a rename onto an untracked file, an accented file name, and a file where the remote adds a folder; each is now a case in
auto-pull.test.sh. When the merge refuses, the saved changes go back and the run fails. Skipped as before: a branch other than the remote's default, unpushed commits, a merge, rebase, cherry-pick or revert half done.A failure is reported as one: a path that is no repo or sits inside one, a missing upstream, a locked index.
pullruns on the left of||, where bash ignoresset -e, so each git call checks its own result.Nothing waits. SSH gets
BatchModeand keepalive timeouts, added to a repo's owncore.sshCommand; HTTPS gets a low-speed limit and no credential prompt; the systemd unit has a start timeout. A user service on Linux does not always inheritSSH_AUTH_SOCK, so without one the script uses the openssh or desktop keyring agent under$XDG_RUNTIME_DIR.This repo is public, so a client's checkout goes in an untracked
~/.config/auto-pull.conf. Written for the bash 3.2 that launchd runs on macOS, which is what the test runs it with.Not tried yet:
onandoffagainst a real launchd and systemd, which needs this merged.