Skip to content

feat: working interactive rebase. #2

Merged
Blankeos merged 11 commits intomainfrom
interactive-rebase
Mar 26, 2026
Merged

feat: working interactive rebase. #2
Blankeos merged 11 commits intomainfrom
interactive-rebase

Conversation

@Blankeos
Copy link
Copy Markdown
Owner

No description provided.

interactive rebases.

Add support for detecting and resuming
interactive rebases that are paused
on disk due to conflicts, edit, or reword
actions. Introduces two rebase
phases: Planning (user configures actions)
and InProgress (rebase running).

Changes:
- parse_rebase_progress() reads
.git/rebase-merge or .git/rebase-apply
  state and returns entry lists
(done/pending) with commit metadata
- hydrate_todo_entries() enriches entries
with author/timestamp from git log
- Separate keybindings and UI for Planning
vs InProgress phases
- InProgress shows progress banner with
remaining entry count, entry status
  indicators (✓/▶ for done/current),
and muted styling for completed entries
- Auto-detects rebase completion on
refresh() and shows success popup
- continue/skip/abort operations work
during in-progress rebases
history.

- Prioritize HEAD branch first in branch listings
- Add 'c' shortcut for checkout by name
- Add '-' shortcut to checkout previous branch
- Enhance branch deletion with menu (local/remote/both
options)
- Add commit message history with Up/Down navigation
- Add exclude_file() for .git/info/exclude support
- Add menu for flexible file ignore options (.gitignore
vs exclude)
- Add root node to file tree and support
directory-level diffs
checkout and improve file tree rendering.

- Show error popup when branch checkout
fails instead of silently failing
- Refactor checkout operations to use
shared error handling function
- Render file tree root directory with
just the expand/collapse icon
of text input for branch/tag/commit
selection.
state between sessions.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d12fab7fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/git/rebase.rs
pub fn rebase_commit_range(&self, base_hash: &str) -> Result<Vec<String>> {
let result = self
.git()
.args(&["rev-list", "--reverse", &format!("{}..HEAD", base_hash)])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exclude merge commits from planned rebase todo

rebase_commit_range currently uses rev-list --reverse <base>..HEAD, which includes merge commits, but rebase_interactive_batch runs plain git rebase -i (without --rebase-merges) and writes those hashes back into the todo. On branches that contain merges, this produces a runtime failure (commit ... is a merge but no -m option was given) and leaves users in a paused/broken rebase flow instead of starting the planned operation.

Useful? React with 👍 / 👎.

Comment on lines +704 to +707
let commits_to_rebase: Vec<_> = rebase_hashes
.iter()
.filter_map(|hash| model.commits.iter().find(|c| c.hash == *hash))
.cloned()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve full commit set when mapping rebase range

This conversion silently drops any hash that is not present in model.commits; because the commits panel can be filtered/limited (for example branch-filter refresh loads a capped list), the generated interactive-rebase plan can become incomplete. The subsequent batch todo is then missing commits that Git intended to replay, which effectively drops history unexpectedly. The mapping should fail fast if any hash is missing, or hydrate entries directly from Git instead of the current view model.

Useful? React with 👍 / 👎.

Comment thread src/git/rebase.rs
Comment on lines +213 to +217
// Prevent git from opening an interactive editor for reword/edit
// actions. `true` exits 0 without modifying COMMIT_EDITMSG, so
// reword keeps the original message (reword message editing is
// handled in the TUI before execution).
.env("GIT_EDITOR", "true")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Let reword actions actually change commit messages

Batch interactive rebase always forces GIT_EDITOR=true, which causes reword steps to continue with the existing message unchanged. In this feature path there is no pre-execution message capture per entry, so selecting reword in the planner is effectively a no-op for commit text and does not deliver the advertised behavior.

Useful? React with 👍 / 👎.

container block

Move header, progress banner, and list inside a
bordered Block container to
improve visual hierarchy. Extract branch/base info into
separate render_info_line
function and simplify selection styling by applying it
at the ListItem level
instead of individual spans. Use theme colors
consistently throughout.
@Blankeos Blankeos merged commit 78b6c5f into main Mar 26, 2026
1 check passed
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