Background
gg continue (crates/gg-core/src/commands/rebase.rs) runs git rebase --continue but does not finalize the op-log record of the operation that was interrupted by the conflict.
When a mutating operation (gg rebase, gg restack, including the mid-stack-insertion integration added in #351) hits a rebase conflict, its OperationGuard is dropped without finalize_*. Per the op-log design that's intentional at drop time — the record stays Pending and the sweep promotes it to Interrupted. But after the user resolves the conflict and runs gg continue, the mutation actually completes successfully, yet the original operation record is never committed. As a result that operation:
- is not reported as undoable, and
- cannot be undone via
gg undo.
This is pre-existing behavior shared by all conflict-resumable paths; it is not specific to the mid-stack integration path, but that path (PR #351) surfaced it (see #351 (comment)).
Proposed approach
- Persist the interrupted operation's id (and any context needed for the post-snapshot) so
gg continue can find it — e.g. alongside the existing pending markers.
- Add an operations API to finalize a
Pending record by id from a separate invocation (snapshot post-mutation refs, mark Committed), and call it from gg continue after the rebase completes.
- Cover both the normal
gg restack/gg rebase conflict paths and the gg restack mid-stack integration path.
- Tests: conflict → resolve →
gg continue → gg undo restores the pre-operation state.
Scope note
Deferred from #351 to keep that feature PR focused and to avoid expanding the undo subsystem as a tail-end change.
Background
gg continue(crates/gg-core/src/commands/rebase.rs) runsgit rebase --continuebut does not finalize the op-log record of the operation that was interrupted by the conflict.When a mutating operation (
gg rebase,gg restack, including the mid-stack-insertion integration added in #351) hits a rebase conflict, itsOperationGuardis dropped withoutfinalize_*. Per the op-log design that's intentional at drop time — the record staysPendingand the sweep promotes it toInterrupted. But after the user resolves the conflict and runsgg continue, the mutation actually completes successfully, yet the original operation record is never committed. As a result that operation:gg undo.This is pre-existing behavior shared by all conflict-resumable paths; it is not specific to the mid-stack integration path, but that path (PR #351) surfaced it (see #351 (comment)).
Proposed approach
gg continuecan find it — e.g. alongside the existing pending markers.Pendingrecord by id from a separate invocation (snapshot post-mutation refs, markCommitted), and call it fromgg continueafter the rebase completes.gg restack/gg rebaseconflict paths and thegg restackmid-stack integration path.gg continue→gg undorestores the pre-operation state.Scope note
Deferred from #351 to keep that feature PR focused and to avoid expanding the undo subsystem as a tail-end change.