mhagger / git-imerge

Incremental merge for git
GNU General Public License v2.0
2.7k stars 125 forks source link

Crash When Performing Standard (i)Merge #81

Open Stunner opened 9 years ago

Stunner commented 9 years ago

I got the following output when attempting to use imerge to merge in https://github.com/odigeoteam/nui/tree/master from https://github.com/Stunner/nui/tree/all-changes.

$ git-imerge merge odigeoteam/master
Attempting automerge of 1-1...success.
Attempting automerge of 1-11...success.
Attempting automerge of 1-17...success.
Attempting automerge of 1-20...success.
Attempting automerge of 1-21...success.
Attempting automerge of 4-21...failure.
Attempting automerge of 3-21...failure.
Attempting automerge of 2-21...failure.
Attempting automerge of 2-1...success.
Attempting automerge of 2-11...failure.
Attempting automerge of 2-6...failure.
Attempting automerge of 2-4...success.
Attempting automerge of 2-5...Traceback (most recent call last):
  File "/usr/local/bin/git-imerge", line 3316, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/git-imerge", line 136, in wrapper
    return f(*args, **kw)
  File "/usr/local/bin/git-imerge", line 3132, in main
    merge_state.auto_complete_frontier()
  File "/usr/local/bin/git-imerge", line 2169, in auto_complete_frontier
    frontier.auto_expand()
  File "/usr/local/bin/git-imerge", line 1324, in auto_expand
    if block.auto_expand_frontier():
  File "/usr/local/bin/git-imerge", line 1622, in auto_expand_frontier
    return self.auto_outline_frontier()
  File "/usr/local/bin/git-imerge", line 1592, in auto_outline_frontier
    merge_frontier = MergeFrontier.compute_by_bisection(self)
  File "/usr/local/bin/git-imerge", line 972, in compute_by_bisection
    2, i2 - 1,
  File "/usr/local/bin/git-imerge", line 212, in find_first_false
    if f(mid):
  File "/usr/local/bin/git-imerge", line 971, in <lambda>
    lambda i: block.is_mergeable(i1, i),
  File "/usr/local/bin/git-imerge", line 1475, in is_mergeable
    automerge(self[i1, 0].sha1, self[0, i2].sha1)
  File "/usr/local/bin/git-imerge", line 563, in automerge
    call_silently(['git', 'checkout', '-f', commit1])
  File "/usr/local/bin/git-imerge", line 230, in call_silently
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'git', u'checkout', u'-f', u'fc97a0495f68b2d6d5082f9bf26ac83ab7688a61']' returned non-zero exit status 128
mhagger commented 9 years ago

Unfortunately I cannot reproduce this error with the current value of the branches that you mentioned. Do you happen to know what the branches' SHA-1s were at the time of the problem? Was the problem repeatable?

Stunner commented 9 years ago

Sorry about that, looks like someone from the odigeoteam committed within the last 12 days. Should be reproducable with these two commits:

https://github.com/odigeoteam/nui/commit/35391f2f14fe57a55b7b39ce228255b41a859b67 and https://github.com/Stunner/nui/commit/a518fab1da88ac0bfba27c4e8402cc27c74c8af6

I tried it twice and got the same issue, so I assume it is repeatable.

Stunner commented 9 years ago

Tried again and it appears to be failing earlier than last time:

$ git-imerge merge odigeoteam/master
Attempting automerge of 1-1...success.
Attempting automerge of 1-11...success.
Attempting automerge of 1-17...Traceback (most recent call last):
  File "/usr/local/bin/git-imerge", line 3316, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/git-imerge", line 136, in wrapper
    return f(*args, **kw)
  File "/usr/local/bin/git-imerge", line 3132, in main
    merge_state.auto_complete_frontier()
  File "/usr/local/bin/git-imerge", line 2169, in auto_complete_frontier
    frontier.auto_expand()
  File "/usr/local/bin/git-imerge", line 1324, in auto_expand
    if block.auto_expand_frontier():
  File "/usr/local/bin/git-imerge", line 1622, in auto_expand_frontier
    return self.auto_outline_frontier()
  File "/usr/local/bin/git-imerge", line 1592, in auto_outline_frontier
    merge_frontier = MergeFrontier.compute_by_bisection(self)
  File "/usr/local/bin/git-imerge", line 898, in compute_by_bisection
    1, block.len2,
  File "/usr/local/bin/git-imerge", line 212, in find_first_false
    if f(mid):
  File "/usr/local/bin/git-imerge", line 897, in <lambda>
    lambda i: block.is_mergeable(i1, i),
  File "/usr/local/bin/git-imerge", line 1475, in is_mergeable
    automerge(self[i1, 0].sha1, self[0, i2].sha1)
  File "/usr/local/bin/git-imerge", line 563, in automerge
    call_silently(['git', 'checkout', '-f', commit1])
  File "/usr/local/bin/git-imerge", line 230, in call_silently
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'git', u'checkout', u'-f', u'8ead12a24669dbd96db16a73fd32c72e56223501']' returned non-zero exit status 128
$ git --version
git version 2.1.0

Ran it again after doing git-imerge remove and got a different error:

$ git-imerge merge odigeoteam/master
Attempting automerge of 1-1...success.
Attempting automerge of 1-12...success.
Attempting automerge of 1-18...success.
Attempting automerge of 1-21...success.
Attempting automerge of 1-23...success.
Attempting automerge of 4-23...failure.
Attempting automerge of 3-23...Traceback (most recent call last):
  File "/usr/local/bin/git-imerge", line 3316, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/git-imerge", line 136, in wrapper
    return f(*args, **kw)
  File "/usr/local/bin/git-imerge", line 3132, in main
    merge_state.auto_complete_frontier()
  File "/usr/local/bin/git-imerge", line 2169, in auto_complete_frontier
    frontier.auto_expand()
  File "/usr/local/bin/git-imerge", line 1324, in auto_expand
    if block.auto_expand_frontier():
  File "/usr/local/bin/git-imerge", line 1622, in auto_expand_frontier
    return self.auto_outline_frontier()
  File "/usr/local/bin/git-imerge", line 1592, in auto_outline_frontier
    merge_frontier = MergeFrontier.compute_by_bisection(self)
  File "/usr/local/bin/git-imerge", line 949, in compute_by_bisection
    i1 + 1, block.len1 - 1,
  File "/usr/local/bin/git-imerge", line 212, in find_first_false
    if f(mid):
  File "/usr/local/bin/git-imerge", line 948, in <lambda>
    lambda i: block.is_mergeable(i, i2 - 1),
  File "/usr/local/bin/git-imerge", line 1475, in is_mergeable
    automerge(self[i1, 0].sha1, self[0, i2].sha1)
  File "/usr/local/bin/git-imerge", line 573, in automerge
    call_silently(['git', 'reset', '--merge'])
  File "/usr/local/bin/git-imerge", line 230, in call_silently
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'git', u'reset', u'--merge']' returned non-zero exit status 128

Reliably crashes but unpredictable as to where it will crash each time...

mhagger commented 9 years ago

@Stunner: I am unable to reproduce the problem, even using those exact commits.

Can you tell me exactly what versions of git-imerge, Git, and what OS you are using? Also the output of running git config --list in that repository (but scrub any passwords if present).

If you are not using the most recent version of git-imerge or are using an older Git version, it might be worth an attempt with updated software.

It is very curious that the failure point is not reproducible. I don't think that any information should carry over from one attempt to run git imerge merge and the next. Theoretically git rerere could do so, but I think git-imerge always turns it off before running git. (If you haven't disabled rerere, that would be worth an experiment: before running imerge, run

git config rerere.enabled false

and see if the error either goes away or becomes more consistently reproducible.)

The commits in question seem to involve a lot of file creation and deletion. Perhaps filename case normalization is turned on and is confusing things (e.g., if you are running this on OSX)?

Stunner commented 9 years ago

Yes I am running this on OS X. I have never used rerere so I don't think that would be an issue.

I am on OS X 10.10.3 with git version 2.1.0 and here is the output from git config --list:

$ git config --list
user.email=a****@gmail.com
user.name=Aaron Jubbal
color.ui=true
push.default=simple
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/Stunner/nui.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.tests.remote=origin
branch.tests.merge=refs/heads/tests
branch.accomodate-custom-controls.remote=origin
branch.accomodate-custom-controls.merge=refs/heads/accomodate-custom-controls
branch.all-changes.remote=origin
branch.all-changes.merge=refs/heads/all-changes
remote.odigeoteam.url=https://github.com/odigeoteam/nui.git
remote.odigeoteam.fetch=+refs/heads/*:refs/remotes/odigeoteam/*
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop