Strange merge failure (would be overwritten by merge / cannot merge)

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

Strange merge failure (would be overwritten by merge / cannot merge)

From: Christoph Haas <hidden>
Date: 2016-06-15 22:47:21

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear list,

I'm struggling with a pretty simple Git repository where I maintain one
of my Debian packages. It has two branches:

 - upstream (contains the unaltered original software unpacked from
   a .tar.gz)
 - master (derived from upstream plus Debian specific changes)

Now I imported a new upstream version into the upstream branch. And then
tried to merge the 'upstream' branch into the 'master' branch to work on
it. And suddenly I get this error:

   error: Entry 'cream-abbr-eng.vim' would be overwritten by merge.
   Cannot merge.

So it looks like the 'cream-abbr-eng.vim' file has been altered. And it
contains some non-ASCII characters (it's a VIM script file) so perhaps
automatic merging fails. But can't I just tell Git to screw my file in
the 'master' branch and just overwrite my file? No merge strategy helped
me accomplish that.

To reproduce my problem:

  $> git clone git://git.workaround.org/cream
  $> cd cream
  $> git merge origin/upstream
  error: Entry 'cream-abbr-eng.vim' would be overwritten by merge.
  Cannot merge.
  fatal: merging of trees 70008c82f82a7985531aa2d039c03fdf944ea267 and
  78d3a35e300434d6369424dd873bb587beacfaa4 failed

Help welcome. I'm no Git guru and totally at a loss here. As a last
resort I would start from scratch losing all of my Git history.

Kindly
 Christoph

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqheHQACgkQCV53xXnMZYZSaQCdF4JovwKUx1FIOq82+joGUIlq
a7UAoIoC2mm2L6Pv7MvZGzOIRNgktb2B
=pklM
-----END PGP SIGNATURE-----

Re: Strange merge failure (would be overwritten by merge / cannot merge)

From: David Aguilar <hidden>
Date: 2016-06-15 22:47:21

On Fri, Sep 04, 2009 at 10:28:36PM +0200, Christoph Haas wrote:
Now I imported a new upstream version into the upstream branch. And then
tried to merge the 'upstream' branch into the 'master' branch to work on
it. And suddenly I get this error:

   error: Entry 'cream-abbr-eng.vim' would be overwritten by merge.
   Cannot merge.

To reproduce my problem:

  $> git clone git://git.workaround.org/cream
  $> cd cream
  $> git merge origin/upstream
  error: Entry 'cream-abbr-eng.vim' would be overwritten by merge.
  Cannot merge.
  fatal: merging of trees 70008c82f82a7985531aa2d039c03fdf944ea267 and
  78d3a35e300434d6369424dd873bb587beacfaa4 failed
Very odd indeed!

$ git version
git version 1.6.4.2.264.g79b4f

I was able to workaround it:

$ rm *
$ git add -u
$ git merge origin/upstream

I've never run into this before.
I think it has to do with all the renamed files.
It looks like you're running into ain unfortunate edge case.

The merge-base of both branches (the initial commit) has all
files underneath a cream/ directory.

Both descendants (upstream and master) moved files up to the
root.  So when you go to merge those histories the merge driver
gets confused.

What happened in master?    cream/A -> A
What happened in upstream?  cream/A -> A

That seems like an edge case that might need some attention.

Anyways, once you do the workaround merge it'll settle
itself out and won't happen to you again since the merge will
resolve it for all your future commits (future merges will
have a new, rename-safe merge base).

Does anyone else on the list have any insights?

-- 
		David

Re: Strange merge failure (would be overwritten by merge / cannot merge)

From: Christoph Haas <hidden>
Date: 2016-06-15 22:47:21

David Aguilar schrieb:
On Fri, Sep 04, 2009 at 10:28:36PM +0200, Christoph Haas wrote:
quoted
Now I imported a new upstream version into the upstream branch. And then
tried to merge the 'upstream' branch into the 'master' branch to work on
it. And suddenly I get this error:

   error: Entry 'cream-abbr-eng.vim' would be overwritten by merge.
   Cannot merge.

To reproduce my problem:

  $> git clone git://git.workaround.org/cream
  $> cd cream
  $> git merge origin/upstream
  error: Entry 'cream-abbr-eng.vim' would be overwritten by merge.
  Cannot merge.
  fatal: merging of trees 70008c82f82a7985531aa2d039c03fdf944ea267 and
  78d3a35e300434d6369424dd873bb587beacfaa4 failed
Very odd indeed!

$ git version
git version 1.6.4.2.264.g79b4f

I was able to workaround it:

$ rm *
$ git add -u
$ git merge origin/upstream
Thank you. I had to "rm -r addons", too, but the general hint helped me
a lot.
I've never run into this before.
I think it has to do with all the renamed files.
It looks like you're running into ain unfortunate edge case.
Actually I'm not aware of any renames. But I don't claim that I always
know what I'm doing. :)
Does anyone else on the list have any insights?
I'd be curious, too.

Kindly
 Christoph
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help