Rebase causes intermittent corruption of index

69 views
Skip to first unread message

Neal Groothuis

unread,
May 1, 2013, 1:44:23 PM5/1/13
to msy...@googlegroups.com
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

Konstantin Khomoutov

unread,
May 1, 2013, 2:02:47 PM5/1/13
to Neal Groothuis, msy...@googlegroups.com
On Wed, 1 May 2013 10:44:23 -0700 (PDT)
Neal Groothuis <neal.gr...@gmail.com> wrote:

> 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.
[...]
> Can someone shed some light onto what might be going on here and how
> it might be worked around or fixed?

Just to provide more context: is your Git repo kept on a regular (NTFS)
filesystem or somewhere else?

Neal Groothuis

unread,
May 1, 2013, 2:12:55 PM5/1/13
to msy...@googlegroups.com, Neal Groothuis

Yep, the repo is on an NTFS filesystem.

Thomas Braun

unread,
May 2, 2013, 3:46:37 PM5/2/13
to msy...@googlegroups.com, neal.gr...@gmail.com
> 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?

Well it is not reproducible here on my machine.

I tried your script and repository with
curl http://www.nealgroothuis.name/rebase-torture.sh -o rebase-torture.sh
curl http://www.nealgroothuis.name/rebase-test.tbz2 -o rebase-test.tbz2
tar xjf rebase-test.tbz2 && cd rebase-test && ../rebase-torture.sh | tee
../ausg

but after one hour or so and roughly 1000 merges still no error.

And I'm using
git version 1.8.1.msysgit.1
on a Win7 x64 SP1.

Thomas

Erik Faye-Lund

unread,
May 2, 2013, 3:58:25 PM5/2/13
to Thomas Braun, msy...@googlegroups.com, neal.gr...@gmail.com
I've seen similar issues triggered by anti-virus software (even
Windows Security Essentials, which one would think uses opportunistic
locks, being made by Microsoft and all... well, apparently not).
Perhaps that's the culprit in Neal's case also?

Neal Groothuis

unread,
May 6, 2013, 9:56:14 AM5/6/13
to msy...@googlegroups.com, Thomas Braun, neal.gr...@gmail.com, kusm...@gmail.com

This appears to be part but not all of the problem.  The torture script no longer crashes, but there is still a rebase that chokes with the "local changes would be overwritten" error.  Thankfully, this error at least happens consistently. :-)

If I can identify the problem or come up with a simple example that replicates it, I'll be back.  Thanks for the help, folks.
Reply all
Reply to author
Forward
0 new messages