Anomalous conflicts during git rebase

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Anomalous conflicts during git rebase

From: <hidden>
Date: 2016-06-15 22:44:01

On a clone of linux-2.6:

    git checkout -b topic/test v2.6.15
    touch drivers/a-file.c
    git add drivers/a-file.c
    git commit -m 'Add a file'
    git checkout -b temp0 v2.6.16
    git rebase topic/test

I get the following:

    Applying [ACPI] handle ACPICA 20050916's acpi_resource.type rename
  
    error: patch failed: drivers/acpi/glue.c:99
    error: drivers/acpi/glue.c: patch does not apply
    error: patch failed: drivers/char/hpet.c:897
    error: drivers/char/hpet.c: patch does not apply
    Using index info to reconstruct a base tree...
    Falling back to patching base and 3-way merge...
    Auto-merged drivers/acpi/glue.c
    Auto-merged drivers/acpi/pci_link.c
    Auto-merged drivers/char/hpet.c
    CONFLICT (content): Merge conflict in drivers/char/hpet.c
    Failed to merge in the changes.
    Patch failed at 0007.
  
    When you have resolved this problem run "git rebase --continue".
    If you would prefer to skip this patch, instead run "git rebase --skip".
    To restore the original branch and stop rebasing run "git rebase --abort".

Is this a bug, or is there a reason I am seeing conflicts in files
I've never touched?

Re: Anomalous conflicts during git rebase

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:44:01

adr3nald0s@gmail.com wrote:
On a clone of linux-2.6:

    git checkout -b topic/test v2.6.15
    touch drivers/a-file.c
    git add drivers/a-file.c
    git commit -m 'Add a file'
    git checkout -b temp0 v2.6.16
    git rebase topic/test

I get the following:

    Applying [ACPI] handle ACPICA 20050916's acpi_resource.type rename
..
    CONFLICT (content): Merge conflict in drivers/char/hpet.c
..
Is this a bug, or is there a reason I am seeing conflicts in files
I've never touched?
You are using the rebase the wrong way round.

The (first) argument to git rebase tells *where the current branch* will be
moved to, and not *which branch to move*.

So, instead of last two commands (git checkout...; git rebase...) you say

    git rebase v2.6.16

and you don't need the branch temp0.

-- Hannes

Re: Anomalous conflicts during git rebase

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:44:01

On Thu, 27 Dec 2007, adr3nald0s@gmail.com wrote:
On a clone of linux-2.6:

    git checkout -b topic/test v2.6.15
    touch drivers/a-file.c
    git add drivers/a-file.c
    git commit -m 'Add a file'
    git checkout -b temp0 v2.6.16
    git rebase topic/test
This will rebase temp0 (= v2.6.16) onto topic/test. This process 
linearizes the history being rebased, and conflicts in that history (that 
were resolved in the merges) show up when the second change to those lines 
gets introduced.

What you probably want is

...
 git commit -m 'Add a file'
 git checkout -b temp0
 git rebase v2.6.16

	-Daniel
*This .sig left intentionally blank*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help