Skip to main content

Module magit_rebase_mode

Module magit_rebase_mode 

Source
Expand description

MG.9: magit-rebase major mode.

Editable interactive rebase todo buffer. C-c C-c runs rebase, C-c C-k aborts.

Fold audit fix: this used to populate the buffer with a hardcoded fake todo and, on C-c C-c, write it straight to .git/rebase-merge/git-rebase-todo and run git rebase --continue — against a rebase that had never actually been started, which always failed silently. The real flow: build the todo from git log against a real upstream, and on C-c C-c actually START the interactive rebase, injecting the buffer’s (possibly user-edited) todo via the standard GIT_SEQUENCE_EDITOR trick — git rebase -i invokes the sequence editor as <editor> <path-to-generated-todo>, so setting it to cp <our-file> replaces git’s todo with ours in one step. GIT_EDITOR=true avoids hanging on a reword step’s commit-message prompt by accepting the original message unchanged.

MG.43c lifted that limitation for the rebase w row, using the same trick one level down: the message is collected in a compose buffer FIRST, then GIT_EDITOR is pointed at cp <message-file> so git’s reword step writes it. GIT_EDITOR=true remains the default for edit and drop, neither of which opens an editor.

The todo buffer itself still keeps the original message on a hand-typed reword line — it has no message-editing UI. That remains a known limitation rather than a silent failure.

Structs§

MagitRebaseMode
RebaseState

Type Aliases§

RebaseStatesHandle
MG.13: service alias for this mode’s per-buffer state (feedback_servicesregistry_arc_typeid).