Repository navigation
fix(claude-config-backup): rebase on rejected push and log the push error - #17
Merged
twistedmelonman merged 1 commit intoOct 28, 2026
Merged
Conversation
…rror The push sent stderr to /dev/null. After a commit landed on the remote from elsewhere on 2026-09-08, every push was rejected non-fast-forward for seven weeks, and the log said only "push failed" each time. - Keep push stderr and put its first !/error:/fatal: line in the WARN line, with any URL userinfo stripped. - When the push is rejected with "(fetch first)" or "(non-fast-forward)", run `git pull --rebase` on the current branch and push once more. - If that rebase conflicts, abort it, log an ERROR naming the conflicting file and the manual fix, and exit 1. Local commits are left intact; nothing force-pushes or resets. - Retry the push on a run with nothing new to commit when HEAD is ahead of origin/<branch> (local ref check, no fetch). Before, a failed push waited until a config file changed again. - Set GIT_TERMINAL_PROMPT=0 on the network calls, since this runs unattended under a LaunchAgent. Adds tests/claude-config-backup.bats, which runs the script against a temp HOME, XDG_DATA_HOME, bare origin, and stubbed gitleaks and stat.
twistedmelonman
deleted the
claude/fix-config-backup-push-rebase-059cfb3e
branch
October 28, 2026 18:32
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.
The backup push sent stderr to /dev/null. After a commit was added to the remote from elsewhere on 2026-09-08, every push from ASIAGO was rejected non-fast-forward for seven weeks. The log said only "push failed", and the clone ended 1026 commits ahead. That was fixed by hand on 2026-10-28; this keeps it from recurring.
!/error:/fatal:line, with URL userinfo stripped.(fetch first)or(non-fast-forward)runsgit pull --rebaseon the current branch and pushes once more.origin/<branch>(local ref check, no fetch). Before, a failed push waited for the next config change.GIT_TERMINAL_PROMPT=0on push and pull, since this runs under a LaunchAgent.Tests: new
tests/claude-config-backup.bats(7 cases) runs the script against a temp HOME and XDG_DATA_HOME, a bare origin and stubbedgitleaks/stat. Against the old script, 4 of the first 5 fail.shellcheck -S infoclean.