A failed push reports only 'failed to push some refs'; the hook's stderr is dropped #465
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#465
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found triaging IW-437.
./iw phase-pr failed with exactly this, and nothing else:
The actual cause was two DisableSyntax.var violations that the pre-push hook had named on stderr, with file, line and column, plus the scalafix command that fixes them. None of that reached the caller. Diagnosing it needed a manual git push to see output the failed command already had in hand.
WHY IT MATTERS. git push's own stderr says only "failed to push some refs" - the hook's report is separate output that the command must forward. A caller reading the message as printed cannot tell a lint block from a rejected non-fast-forward, an auth failure, or a missing remote. For an agent the two plausible next moves - retry the push, or push with --no-verify - are both wrong, and one of them defeats the hook on purpose.
This recurs. It happened again while closing IW-437: the first feature-branch push failed and printed only the bypass banner, and the run had to be repeated to see the reason.
WHERE. phase-pr's push error path (core/commands/PhasePr.scala:115) and whatever env.git.push returns. Any other place a push error is reported should be checked for the same drop.
PROPOSED FIX. Forward the push subprocess's stderr through the failure message rather than replacing it with a summary line.
Fixed in PR #501 (merge
d1eba9c4).GitAdapter.pushnow forwards both streams, so a hook that blocks a push says why. All three reporting call sites print the message whole and needed no change.GitAdapter.commithas the identical defect and was left alone under the smallest-change rule — filed separately.