rebase oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, I'm encountering a rebase oddity, and would welcome advice on how I could debug it far enough to characterize it so I can (one or both of) report it as a bug, or detect and avoid the situation.

I can reproduce this on my primary development host, running git-2.11.0 on a debian (jessie) VM hosted on a Windows-10 machine via VirtualBox 5.2.2, on a filesystem native to a real debian machine mounted over Samba and imported by VirtualBox into the VM. I have not been able to reproduce it on similar checkouts on the real debian machine, nor in a Cygwin shell over a native Windows partition (running git-2.11.0 in each case). I have not yet attempted to update git version (which would involve getting permission to do so).

In short: rebase stops on the second commit with the claim "Your local changes to the following files would be overwritten by merge: lib/NL/Control/Enrich.pm"; this file did not have local changes, and was not modified by any commit other than this one beyond the merge-base in either branch. I would expect it to apply cleanly during rebase, and indeed cherry-picking it at the same point manages to apply it with no problem. GIT_TRACE=1 does not show enough detail for me to guess what's going wrong, are there other diagnostic options that would show more detail, short of strace(1)?

I've done numerous similar rebases in this environment, and not had anything like this happen before.

The long version follows, any clues gratefully received.

Hugo van der Sanden

<<END

The setup is a parent branch with a fresh merge of a single commit, and a child branch that needs updating:

merge-base A=823cbe6f1fdb9b3b5aed43de84380e8beb220ec1
parent (at C):
  commit B=097d2c7e648c87a927a77d0f39ed0e53149320ef (parent A)
  merge commit C=94ba94817003f2ca72301882b6be5744b3919d06 (Merge A B, was fast-forwardable)
child (at G):
  commit D=1d98a92010c2a2929c178340683d890cab8e056a (parent A) commit-message mD
  commit E=0960ab2979c74f10cd0b39c6893b69adac79d8cd (parent D) commit-message mE
  commit F=2abf3b4ffdea7de86c4e7e5109fb6e974a9e9c67 (parent E) commit-message mF
  commit G=2ec06a698ac5c6eb927e1849e5536f1f0ed36895 (parent F) commit-message mG

When from a clean state I invoke 'git checkout child; git rebase HEAD~4 --onto parent', I get this:

% git status
On branch child
nothing to commit, working tree clean
% git rebase HEAD~4 --onto parent
First, rewinding head to replay your work on top of it...
Applying: mD
Applying: mE
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:
        lib/NL/Control/Enrich.pm
Please commit your changes or stash them before you merge.
Aborting
error: Failed to merge in the changes.
Patch failed at 0002 mE
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

% git status
rebase in progress; onto 94ba948
You are currently rebasing branch 'child' on '94ba948'.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working tree clean
% git diff HEAD
% 

Commit D changes 10 files, including 3 renames; commit E changes 3 files (including " lib/NL/Control/Enrich.pm"), none of which is touched by D.

If I reorder the commits in child using interactive rebase to be (D, F, G, E), the rebase still fails exactly the same way at E. If I then skip that commit to complete the rebase, I can successfully cherry-pick E to get exactly the result I expected of the rebase.

The original rebase with GIT_TRACE=1 yields:
15:01:52.522578 git.c:600               trace: exec: 'git-rebase' 'HEAD~4' '--onto' 'parent'
15:01:52.522730 run-command.c:350       trace: run_command: 'git-rebase' 'HEAD~4' '--onto' 'parent'
15:01:52.524820 git.c:371               trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' 'HEAD~4' '--onto' 'parent'
15:01:52.526160 git.c:371               trace: built-in: git 'rev-parse' '--git-dir'
15:01:52.529971 git.c:371               trace: built-in: git 'rev-parse' '--git-path' 'objects'
15:01:52.533615 git.c:371               trace: built-in: git 'rev-parse' '--is-bare-repository'
15:01:52.537067 git.c:371               trace: built-in: git 'rev-parse' '--show-toplevel'
15:01:52.543825 git.c:371               trace: built-in: git 'config' '--bool' 'rebase.stat'
15:01:52.548413 git.c:371               trace: built-in: git 'config' '--bool' 'rebase.autostash'
15:01:52.554723 git.c:371               trace: built-in: git 'config' '--bool' 'rebase.autosquash'
15:01:52.559588 git.c:371               trace: built-in: git 'config' '--bool' 'commit.gpgsign'
15:01:52.561834 git.c:371               trace: built-in: git 'rev-parse' '--verify' 'HEAD~4^0'
15:01:52.573794 git.c:371               trace: built-in: git 'rev-parse' '--verify' 'parent^0'
15:01:52.588723 git.c:371               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
15:01:52.591557 git.c:371               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
15:01:52.598194 git.c:371               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
15:01:52.609517 git.c:371               trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
15:01:52.741980 git.c:371               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
15:01:52.868020 git.c:371               trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
15:01:52.880407 git.c:371               trace: built-in: git 'merge-base' '94ba94817003f2ca72301882b6be5744b3919d06' '2ec06a698ac5c6eb927e1849e5536f1f0ed36895'
15:01:52.894183 git.c:371               trace: built-in: git 'rev-parse' '--git-path' 'hooks/pre-rebase'
First, rewinding head to replay your work on top of it...
15:01:52.902352 git.c:371               trace: built-in: git 'checkout' '-q' '94ba94817003f2ca72301882b6be5744b3919d06^0'
15:01:53.082451 git.c:371               trace: built-in: git 'update-ref' 'ORIG_HEAD' '2ec06a698ac5c6eb927e1849e5536f1f0ed36895'
15:01:53.092045 git.c:371               trace: built-in: git 'format-patch' '-k' '--stdout' '--full-index' '--cherry-pick' '--right-only' '--src-prefix=a/' '--dst-prefix=b/' '--no-renames' '--no-cover-letter' '823cbe6f1fdb9b3b5aed43de84380e8beb220ec1...2ec06a698ac5c6eb927e1849e5536f1f0ed36895'
15:01:53.120678 git.c:371               trace: built-in: git 'am' '--rebasing' '--resolvemsg=
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
'
15:01:53.123889 run-command.c:350       trace: run_command: 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
15:01:53.124187 exec_cmd.c:116          trace: exec: 'git' 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
15:01:53.124668 git.c:371               trace: built-in: git 'mailsplit' '-d4' '-o.git/rebase-apply' '-b' '--'
Applying: mD
Applying: mE
15:01:53.350845 run-command.c:350       trace: run_command: 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
15:01:53.351119 exec_cmd.c:116          trace: exec: 'git' 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
15:01:53.354153 git.c:371               trace: built-in: git 'apply' '--build-fake-ancestor=.git/rebase-apply/patch-merge-index' '.git/rebase-apply/patch'
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:
        lib/NL/Control/Enrich.pm
Please commit your changes or stash them before you merge.
Aborting
error: Failed to merge in the changes.
Patch failed at 0002 mE
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

% 

END




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux