Repository navigation
Push past target-repo hooks, show git's stdout on failure, and keep unpushed work - #56
Merged
Merged
Conversation
Every push thirdshift makes now skips the target repo's hooks. A failed git command reports the last lines of its stdout as well as its stderr, so a pre-push hook's explanation reaches the user. When the Failed run path can't push, the worktree and local Issue branch are kept and stderr names the branch, head commit and worktree path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the worktree's kept line factual and state the reason where the push failed, tidy names and comments, and test an unreachable origin too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README step 5-7: keep this branch's note that the push skips the repo's git hooks and the Failed-run exception to cleanup, alongside main's note that a Base branch moving during CI is merged again, at most 3 times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Summary
A git hook in the target repo can no longer block a Run's pushes. Failed git commands now say why they failed. A Failed run whose work didn't reach origin keeps that work locally.
README, CONTEXT.md and ADR 0002 now describe the hook skipping and the kept worktree. The integration tests share a
launch_has_rejecting_pre_push_hookscenario helper.Evidence
Before: the new tests fail against
main's code:Git::runpushes to a bare repo whosepre-pushhook echoeshook says noand exits 1. The error says onlyfailed to push some refs; the hook's line is missing. (On git 2.43 too, the hook's output went to stdout, so this test really does exercise the stdout path.)failed_run: when an originpre-receivehook rejects the push, nothing says what was kept, and the worktree and branch are deleted.failed_run: when apre-pushhook in the launch clone exits 1, the failure commit never reaches origin.After: those tests and the new ones below all pass.
cargo clippy --all-targetsandcargo fmt --checkare clean.fresh_run::a_rejecting_pre_push_hook_in_the_target_repo_does_not_block_the_pushfailed_run::a_rejecting_pre_push_hook_in_the_target_repo_does_not_block_the_failure_pushfailed_run::when_origin_rejects_the_failure_push_the_worktree_and_local_branch_are_keptfailed_run::when_origin_is_unreachable_for_the_failure_push_the_worktree_and_local_branch_are_keptgit::tests::a_failure_includes_a_hooks_output_and_gits_own_errorgit::tests::a_failure_includes_stdoutgit::tests::a_failure_keeps_only_the_last_lines_of_a_streamgit::tests::a_failure_with_nothing_on_either_stream_says_only_that_git_failedThe existing cleanup tests still pass, including the case where there's nothing to push.
cargo test --no-fail-fastpasses exceptci::waits_for_github_to_work_out_whether_the_pr_is_mergeable. That test fails intermittently under parallel load, and it fails the same way on an untouchedmaincheckout.Merge Danger
Door: two-way
Reverting brings back the old push, error and cleanup behavior.
Blast Radius: pushes
Every Run now skips the target repo's local git hooks when it pushes. That's intended: the session runs the tests and CI gates the PR. But a team that relied on a local pre-push hook as a gate loses it for thirdshift's pushes. Git failure messages get longer, up to 20 lines. A Failed run whose push fails now leaves a worktree next to the clone, which you have to remove by hand.
Unaddressed findings
Standards
src/git.rsunit tests andtests/support. Unit tests and integration tests are separate crates. Sharing about 10 lines would need a new test-utility module.kept: boolflag switch inDrop for Worktree. The reviewer judged it acceptable at this size.pushed.is_err()checked twice infailed_run::fail. The reviewer judged it fine: the ordering comment explains whykeepcomes last.Spec
commit_and_pusherror, not only a failed push. This is deliberate. Ifmerge --abort,add, the diff check or the commit fails, we don't know the work is safe on origin, so keeping it is the conservative choice.Drop, not explicitly infail(). It still prints the path, branch and head SHA as asked, and cleanup and reporting stay together in one place.pushing issue-Nline on the Failed run path, and everygit.runerror now including stdout. All are kept. They follow from sending both pushes throughWorktree::pushand from the stdout fix, and nothing parses git error text.Closes #55
🤖 Generated with Claude Code