Skip to content

rebase-helper: pan done can push a half-rebased HEAD; --ours drops .pan edits during rebase #6007

Backlog

Description

@eltmon

Found by a real-git test written for #5754 (rebase-helper-state.test.ts on feature/pan-5754). That test fails against main's src/lib/rebase-helper.ts.

Bug 1: pan done can push a half-rebased HEAD. When a rebase is already in progress, HEAD sits on the target. The helper takes its "already rebased" path, reports success, and pushes the mid-rebase HEAD to the feature branch.

  • Trigger: pan done runs while a rebase is cleanly paused (an edit or break stop, or --force). With conflicts, the clean-tree check refuses first.
  • Fix (already on feature/pan-5754, PR PAN-5754 #5993): check for an in-progress rebase before anything else, and refuse to continue rebase state the helper didn't start in the same call.
  • Close: this issue when PAN-5754 #5993 merges, or land the fix separately if PAN-5754 #5993 is delayed.

Bug 2: --ours during a rebase keeps the target's copy of a conflicting .pan file. During a rebase, --ours is the target branch's side, not the feature's. So a conflicting .pan file reverts to main's copy, and that commit's planning edits are silently dropped. The code comment ("local wins", "never shared in main") is wrong on both counts.

  • Fix: use --theirs during a rebase (the commit being replayed), or resolve .pan conflicts explicitly.
  • Test: a test where the feature commit's .pan edit survives a rebase conflict.

Activity

  1. added
    bug
    substrate-improvement
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsubstrate-improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions