Display rebase progress in status buffer - #4
Open
sei40kr wants to merge 3 commits into
Open
Conversation
While a rebase is underway the status buffer now shows Magit's
rebase-sequence section ("Rebasing topic onto main"): the remaining
todo lines, the commit the rebase stopped at, the commits already
applied, and the base — newest first, read like a log. Every row is a
Commit section, so RET shows the commit and the cursor sticks to it
across refreshes.
- StatusSnapshot grows rebase: Option<RebaseInfo>; the sequencer state
is read from rebase-merge/ (and rebase-apply/ for the am backend,
parsing the mailbox patch files) plus a few small git reads that only
run mid-rebase. Full ids from the sequencer's files are abbreviated
through one batched no-walk log.
- Step assembly is a pure function (parse.rs) unit-tested for both stop
shapes: a conflict (not yet applied, own row) and an edit (applied,
marked in place among the done commits).
- New theme roles sequence-stop / sequence-done / sequence-onto; pending
rows reuse todo-action, aligned like the todo editor.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014zsTaZna79VjjCAddF8BT1
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zsTaZna79VjjCAddF8BT1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a rebase-sequence section to the status buffer showing the progress of an in-progress rebase, matching Magit's display style.
Summary
This change adds comprehensive rebase progress tracking to the status buffer. When a rebase is in progress (either interactive or am-backend), a new "Rebasing X onto Y" section appears at the top, displaying:
Each row is a clickable commit section, allowing users to visit commits during a rebase.
Key changes
Parser additions (
git/parse.rs):parse_hash_subject(): Extract commit hash and subject fromgit logoutputparse_mail_patch(): Parse mailbox-format patch files from am-backend rebasesassemble_rebase_steps(): Assemble the display rows from sequencer state (todo, stop point, applied commits, base)Rebase detection and reading (
git/client.rs):read_rebase(): Detect and read rebase state fromrebase-merge/(interactive) orrebase-apply/(am-backend) directoriesapply_backend_pending(): Extract pending commits from numbered patch filesabbreviate_todo(): Batch-resolve full commit ids to short hashes for displayDisplay types (
git/types.rs):SeqKindenum: Categorizes commits (Pending, Stop, Done, Onto)SeqStepstruct: One row of rebase progressRebaseInfostruct: Complete rebase state for displayUI rendering (
ui/build.rs):rebase_section(): Build the rebase-sequence section with color-coded step wordsTodo parsing (
git/todo.rs):parse_todo_display(): Lenient parser for display (skips unsupported instructions likeexec,break,label)Theme (
src/theme.rs):sequence_stop,sequence_done,sequence_ontocolor roles for rebase step stylingTests:
Implementation notes
rebase-merge/(interactive) andrebase-apply/(am-backend) directoriesgit log onto..HEADto avoid relying on sequencer state filesgit name-rev) when possible, falling back to its short hashhttps://claude.ai/code/session_014zsTaZna79VjjCAddF8BT1