Skip to content

Expose merge and rebase operation state#70

Merged
cosentinode merged 2 commits into
developfrom
issue-53-repository-operation-state
Jul 14, 2026
Merged

Expose merge and rebase operation state#70
cosentinode merged 2 commits into
developfrom
issue-53-repository-operation-state

Conversation

@cosentinode

Copy link
Copy Markdown
Owner

Summary

  • add typed merge/rebase operation state to Git worktree status
  • detect MERGE_HEAD plus rebase-merge and rebase-apply independently of conflict entries
  • retain cherry-pick/revert guardrails and show an in-progress banner in the status panel

Verification

  • cargo fmt --all --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace

Fixes #53

Comment thread crates/bitbygit-git/src/lib.rs Outdated
if self.git_path("MERGE_HEAD")?.exists() {
return Ok(Some(RepositoryOperation::Merge));
}
if self.git_path("rebase-merge")?.exists() || self.git_path("rebase-apply")?.exists() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

rebase-apply is not sufficient to identify a rebase: a paused git am session creates this directory too (with rebase-apply/applying). I reproduced this with an empty patch: git status reported "You are in the middle of an am session", while this branch would set status.operation to RepositoryOperation::Rebase and show REBASE IN PROGRESS. That makes the newly exposed typed state false and will also misdirect later recovery UX. Please distinguish the git am form (or model it separately) while retaining its existing guardrail. The test currently creates a bare rebase-apply directory, so it misses the real marker layout.

@cosentinode

Copy link
Copy Markdown
Owner Author

Fixed the paused git am misclassification in commit 28bde7a.

rebase-apply/applying is now excluded from typed rebase state while remaining covered by the clean-worktree guardrail as an am operation. The regression creates a real paused empty-patch git am session and verifies that status reports no rebase and checkout remains blocked.

Verification:

  • cargo fmt --all --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace

@cosentinode

Copy link
Copy Markdown
Owner Author

ZERO CONCERNS

Reviewed current head 28bde7a25e4ef2d197240ebc6866b7b3cfbe97a5 against #53, including the complete diff, surrounding Git/TUI code, operation-state edge cases, added regression coverage, and CI. Independent verification passed: cargo fmt --all --check, cargo clippy --locked --workspace --all-targets -- -D warnings, cargo test --locked --workspace, and git diff --check origin/develop...HEAD. GitHub Rust and GitGuardian checks are passing.

@cosentinode cosentinode merged commit c943648 into develop Jul 14, 2026
2 checks passed
@cosentinode cosentinode deleted the issue-53-repository-operation-state branch July 14, 2026 18:05
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.

[Phase 12] Promote merge and rebase progress into repository status

1 participant