Skip to content

fix: retry a rejected push even when git prints no hints - #204

Merged
polyrainbow merged 1 commit into
mainfrom
fix/sync-rejected-push-without-hints
Nov 6, 2026
Merged

polyrainbow merged 1 commit into
mainfrom
fix/sync-rejected-push-without-hints

Conversation

@polyrainbow

Copy link
Copy Markdown
Owner

Summary

CI on main failed after #203: 9 of the new git specs passed locally but failed on the runner.

 // electron/git/classifyError.ts
-  const text = error.stderr;
+  const text = `${error.stderr}\n${error.stdout}`;
  • Rejected push (8 specs): with --porcelain, git push writes [rejected] to stdout; stderr only carries the "Updates were rejected" hints, and advice.* config switches those off, as it evidently is on the runner. A rejected push was classified as "other", so it never pulled and retried, and the commits waited for the next scheduled pull. This is a real bug for any user with those hints off, not just a CI quirk. GitError now keeps stdout, and the classifier reads both streams.
  • UTC offset (1 spec): the zone +0000 came out as -0, which fails toBe(0) on a UTC runner.

Evidence

  • Before: CI run 42186557827 on main had Tests 9 failed | 341 passed. Locally, the same 8 sync failures reproduce with advice.pushUpdateRejected, advice.pushFetchFirst and advice.pushNonFFCurrent set to false.
  • After: two new specs, red before the fix and green after:
    • retries a rejected push when git prints no hints (sets those advice.* options through extraConfig)
    • reports UTC as a timezone offset of 0, not -0
    • The full suite passes with hints off and TZ=UTC (352 passed), and also normally (352 passed).

Merge Danger

Door: two-way

Blast Radius: auto-sync

Only the error classification and one arithmetic line change.

🤖 Generated with Claude Code

`git push --porcelain` reports a rejected ref on stdout; stderr only
carries the "Updates were rejected" hints, and those can be switched off
with advice.* — as on the CI runner. The classifier read stderr alone,
so there a rejected push was "other" instead of "rejected": no pull, no
retry, and the commits waited for the next scheduled pull. Classify on
both streams.

Also report UTC as a timezone offset of 0 rather than -0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyrainbow
polyrainbow merged commit 4759d15 into main Nov 6, 2026
6 checks passed
@polyrainbow
polyrainbow deleted the fix/sync-rejected-push-without-hints branch November 6, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant