atxtechbro / atxtechbro/dotfiles
fix[mcp]: git_rebase --continue fails with complex merge conflicts
- Dominant language
- Shell
- Stars
- 27
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
The `git_rebase` tool in the MCP server fails to properly handle `--continue` operations when there are complex merge conflicts.
## Problem Description
When using `mcp__git__git_rebase` with `continue_rebase: true`, the tool fails with "needs merge" error even after conflicts have been resolved and files staged. This appears to be related to git's index having multiple staged versions of files (stages 1, 2, 3).
## Reproduction Steps
1. Create a feature branch with changes
2. Make conflicting changes on main
3. Attempt to rebase feature branch onto main
4. Resolve conflicts and stage files
5. Use `mcp__git__git_rebase` with `continue_rebase: true`
6. Observe failure with "needs merge" error
## Expected Behavior
The rebase should continue after conflicts are resolved and staged.
## Actual Behavior
The tool fails repeatedly with:
```
Error continuing rebase: Cmd('git') failed due to: exit code(1)
cmdline: git rebase --continue
stdout: 'path/to/file: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add'
```
## Root Cause Analysis
When git has conflict markers in its index (stage 1/2/3 entries visible with `git ls-files -s`), the standard `git add` may not be sufficient. The index needs to be cleared first.
## Proposed Solution
1. Check for index conflicts before attempting --continue
2. Clear index conflicts if present
3. Provide better error messages suggesting workarounds
4. Consider adding a dedicated conflict resolution helper
## Workaround
For now, use regular bash git commands for complex rebases, or abort and try alternative strategies.
Related to git workflow improvements.
Principle: developer-experience
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the MCP server implementation of the git_rebase tool and reproduce the reported flow with a complex conflict. Inspect the index with git ls-files -s before and after staging, then verify that continue_rebase succeeds after conflicts are resolved and that failures provide a useful workaround or error message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, git
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100