fix(branch_sweep): keep the error when a delete fails, and stop early - #282
Merged
Conversation
The first org-wide delete run failed 99 times across five repos and the log recorded nothing but the word FAILED, 99 times. Nothing was deleted, which is the right outcome — but the run could not say why, because the push was written as `git push origin --delete "$b" >/dev/null 2>&1`. That is the same defect this tool was built to avoid, one level up: a result with no information in it, rendered as though it were a finding. The error text is the only thing a failed push carries. Keep it. Two changes: - The push's stderr is captured and the salient line printed beside the branch, so `FAILED <branch> — <reason>` says what actually happened. - After three consecutive failures the repo is abandoned with an explicit note. Delete permission is a property of the credential, not of the branch, so the first few already answer the question for all of them; continuing only buries the reason under 96 more identical lines and spends API budget proving something already known. Both are pinned by tests against an origin configured `receive.denyDeletes`, the closest local stand-in for a credential that may read but not delete: one asserts the reason survives, the other that the run stops at three, exits non-zero, and leaves every branch in place. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KwqicJpMqmcT5RVbyNwdKq
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.
What happened
The first org-wide delete run (run 32866256086) failed 99 times across five repos and the log recorded nothing but the word
FAILED, 99 times:Nothing was deleted, which is the right outcome. But the run could not say why, because the push was written as:
That is the same defect this tool exists to avoid, one level up: a result with no information in it, presented as though it were a finding. The error text is the only thing a failed push carries.
Changes
FAILED <branch> — <reason>.Checks
pytest tests/→ 510 passed ·check_skill_line_counts.sh→ OK ·repos_sync.py --check→ all 12 green.Both changes are pinned by tests against an origin configured
receive.denyDeletes— the closest local stand-in for a credential that may read but not delete. One asserts the reason survives; the other that the run stops at three, exits non-zero, and leaves every branch in place.🤖 Generated with Claude Code
https://claude.ai/code/session_01KwqicJpMqmcT5RVbyNwdKq
Generated by Claude Code