Skip to content

fix(git-backup): abort unfinished rebase on pull --rebase failure#35

Merged
vidhartbhatia merged 1 commit into
mainfrom
fix-rebase-conflict-recovery
May 4, 2026
Merged

fix(git-backup): abort unfinished rebase on pull --rebase failure#35
vidhartbhatia merged 1 commit into
mainfrom
fix-rebase-conflict-recovery

Conversation

@vidhartbhatia
Copy link
Copy Markdown
Collaborator

Adversarial review of v1.0.4 plan caught the only guardrail-class bug actually likely to bite real users.

Bug

backupToGit runs git pull --rebase before pushing. If the rebase failed, the previous code didn't error-check it. Repo was left in unfinished-rebase state. Every subsequent save then silently failed because git refuses commits while a rebase is in progress.

Fix

  • Capture pull --rebase exit code
  • On failure, log + git rebase --abort to clean up
  • Skip the push (propagating desynced state would multiply the problem)
  • New pull-conflict action so callers can distinguish from generic failures

User-facing impact: local saves keep working; only remote sync pauses until conflict resolved. Next save retries cleanly.

Tests

+1 regression test. 107 → 108, all green.

When backupToGit ran git pull --rebase before pushing, an unhandled rebase
failure (cross-machine conflict, network blip) left the data-dir repo in
an unfinished-rebase state. Every subsequent save then silently failed
because git refuses new commits while a rebase is in progress.

Now: detect non-zero exit, log the failure, run git rebase --abort to
clean up, and skip the push (we'd just propagate desynced local state).
Local saves continue working; only remote sync pauses until conflict
is resolved.

Found by adversarial review of v1.0.4 plan — the only guardrail-class
bug actually likely to bite real users with cross-machine sync enabled.

+1 regression test covering the new pull-conflict action.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vidhartbhatia vidhartbhatia requested a review from a team as a code owner May 4, 2026 06:56
@vidhartbhatia vidhartbhatia merged commit 0f6566a into main May 4, 2026
14 checks passed
@vidhartbhatia vidhartbhatia deleted the fix-rebase-conflict-recovery branch May 4, 2026 07:00
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