Hello,
My organization is using msysGit 1.8.1 on Windows 7. When performing rebases, we intermittently encounter issues which appear to stem from the index not being updated properly.
Specifically, we have seen:
- the "opposite sets of modifications" issue seen here:
http://stackoverflow.com/questions/13183534/why-does-git-rebase-leave-opposite-sets-of-modifications-in-the-stage-and-the- a "Dirty index: cannot apply patches (dirty: bar.txt baz.txt foo.txt)" error in the middle of applying rebase commits, which causes the rebase to fail
- unexpected use of the index to reconstruct a base tree, followed by the rebase failing with an error about local changes that would be overwritten by the merge.
To elaborate on the last issue, when the rebase runs successfully, we see:
First, rewinding head to replay your work on top of it...
Applying: commit message 1
Applying: commit message 2
Applying: commit message 3
Running the exact same rebase will intermittently yield this instead:
First, rewinding head to replay your work on top of it...
Applying: commit message 1
Applying: commit message 2
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Applying: commit message 3
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: Your local changes to the following files would be overwritten by merge:
a/b/c/foo.txt
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
I wrote a torture script which can replicate the issue, which is available here:
http://www.nealgroothuis.name/rebase-torture.sh, and a sample repo to run it on here:
http://www.nealgroothuis.name/rebase-test.tbz2 . (The script should be run from in the repo; i.e., ../rebase-torture.sh). I'll get an error within 2 minutes of the script starting on my machine. It does not generate any errors when run a Linux system (tested against version 1.7.9.5).
Can someone shed some light onto what might be going on here and how it might be worked around or fixed?
Thanks.
- Neal