git-remote-entire: relay helper-status before send-pack exit check - #1364
Merged
Conversation
send-pack exits non-zero on per-ref rejections (D/F conflict, protected branch, server hook decline). The buffered `error refs/X <reason>` lines are what git's transport-helper.c reads to render the user-visible `! [remote rejected]` output. Forwarding helper-status only on the happy path meant Wait/feed errors swallowed those lines, leaving users with only `send-pack exited with error: exit status 1`. Relay helper-status before checking exit codes so the real reason reaches the user. Examples now surfaced: Branch protection violation ! [remote rejected] branch-test -> branch-test (upstream: push declined due to repository rule violations) error: failed to push some refs to 'X' Invalid ref: ! [remote rejected] test-prefix -> test-prefix (ref name conflicts with an existing ref namespace) error: failed to push some refs to 'X' Permissions: ! [remote rejected] new-test/repo -> new-test/repo (pushing to GitHub: tracing transport: handshake: http transport: authorization failed: unexpected requesting "https://github.com/x/x/info/refs?service=git-receive-pack" status code: 403: Permission to x/x.git denied to <user>.) error: failed to push some refs to 'X' Assisted-by: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: 25d3ab26f571
Contributor
There was a problem hiding this comment.
Pull request overview
Improves git-remote-entire push error reporting by ensuring send-pack --helper-status output is relayed to Git before returning on send-pack/feeder errors, so Git can render per-ref rejection reasons (e.g., branch protection, invalid ref, permission failures) instead of only a generic exit-status error.
Changes:
- Reorders
handlePushto write the buffered helper-status lines tostdoutprior to checking feeder errors andsend-packexit status. - Keeps the push status batch terminator (
blank line) immediately after relaying helper-status so Git can finish parsing the status section even on failure.
nodo
previously approved these changes
Jun 4, 2026
handlePush relays send-pack's helper-status lines to stdout before checking the subprocess exit code, so per-ref rejections (branch protection, D/F conflict, server hook decline) reach git's transport-helper.c and render as `! [remote rejected] <ref> (<reason>)`. Pin that ordering: a PATH-injected shell stub plays the role of `git send-pack`, emits an empty wrapped request followed by a trailing flush + `error <ref> ...` helper-status line, and exits 1. The test asserts that handlePush both returns the exit error AND has already written the helper-status to stdout. Verified failing against the pre-fix push.go (helperStatus empty in stdout). Assisted-by: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: d814978a0c6c
pjbgf
enabled auto-merge
June 4, 2026 13:31
squishykid
approved these changes
Jun 4, 2026
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.
https://entire.io/gh/entireio/cli/trails/515
send-pack exits non-zero on per-ref rejections (D/F conflict, protected branch, server hook decline). The buffered
error refs/X <reason>lines are what git's transport-helper.c reads to render the user-visible! [remote rejected]output. Forwarding helper-status only on the happy path meant Wait/feed errors swallowed those lines, leaving users with onlysend-pack exited with error: exit status 1.Relay helper-status before checking exit codes so the real reason reaches the user. Examples now surfaced:
Branch protection violation
Invalid ref
Permissions:
Note
Low Risk
Small control-flow reorder in push handling; improves error output without changing auth or pack upload behavior.
Overview
Fixes push error reporting in the Entire git remote helper by writing
send-packhelper-status to git before waiting on the feeder goroutine orsend-packexit code.When the remote rejects refs (branch rules, bad ref names, auth failures),
send-packstill emitserror refs/...lines but exits non-zero. The old order returned onWait/feedErrfirst, so those lines never reached git and users only saw a genericsend-pack exited with error: exit status 1. Git can now show the usual! [remote rejected]messages with the real reason.Reviewed by Cursor Bugbot for commit ad52a59. Configure here.