git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git can't merge two identical move file operation
@ 2006-11-16 10:26 Alexander Litvinov
  2006-11-16 11:32 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Litvinov @ 2006-11-16 10:26 UTC (permalink / raw)
  To: git

Hello,

I have a git repo build using cvsimport. It has 'bad' directory
structure and I want to 'fix' it after each incremental update from
cvs. Here is the idea: I have 2 permanent branches master (to work
with) and cvs (to import from cvs) and one temporary branch to move
files across the project to make directory structure better. Movement
operation is always the same: move directories/files from one place to
another. But merging from temp branch to work branch fail with error
text :
CONFLICT (rename/delete): Rename a->b/a in HEAD and deleted in 791371

Here is the example script:
>git version
git version 1.4.4
> mkdir 1 && cd 1 && git init-db
defaulting to local storage area
> echo 1 > a && git add a && git commit -a -m '1'
Committing initial tree 2ce1eef76631e82282e0f7f0cf9e6f3e9a4a0b1e
> git checkout -b fix
> mkdir b && git mv a b/ && git commit -a -m 'fix 1'
> git checkout -b work master
> git pull . fix
Updating 7be4ab0..d4909bb
Fast forward
 a => b/a |    0
 1 files changed, 0 insertions(+), 0 deletions(-)
 rename a => b/a (100%)
> git checkout -f master
> echo 2 >> a && git commit -a -m '2'
> git checkout -b fix2 master
> mkdir b && git mv a b/ && git commit -a -m 'fix 2'
> git checkout -f work
> git pull . fix2
Trying really trivial in-index merge...
fatal: Merge requires file-level merging
Nope.
Merging HEAD with 791371d91c34bc45b289319d96ebf35c8be385a0
Merging:
d4909bb fix 1
791371d fix 2
found 1 common ancestor(s):
7be4ab0 1
CONFLICT (rename/delete): Rename a->b/a in HEAD and deleted in
791371d91c34bc45b289319d96ebf35c8be385a0
Automatic merge failed; fix conflicts and then commit the result.
>

Bot fix and fix2 are temp branches and supposed to be deleted.

Why git can't merge such changes ? It should know that work holds
renamed version of file a from master and fix2 holds new renamed file
a from master too. Why it can't apply changes of a from master to work

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git can't merge two identical move file operation
  2006-11-16 10:26 Git can't merge two identical move file operation Alexander Litvinov
@ 2006-11-16 11:32 ` Junio C Hamano
  2006-11-16 12:14   ` Alexander Litvinov
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-11-16 11:32 UTC (permalink / raw)
  To: Alexander Litvinov; +Cc: git

"Alexander Litvinov" <litvinov2004@gmail.com> writes:

> Here is the example script:
>>git version
> git version 1.4.4
>> mkdir 1 && cd 1 && git init-db
> defaulting to local storage area
>> echo 1 > a && git add a && git commit -a -m '1'
> Committing initial tree 2ce1eef76631e82282e0f7f0cf9e6f3e9a4a0b1e

Could you try an exactly the same sequence except to make the
initial contents of the file 'a' a bit more meaningful (I
typically use COPYING file in git.git repository for something
like this), by replacing the above "echo 1 > a ..." line with:

	$ cat COPYING >a && git add a && git commit -a -m '1'

and see if it still breaks?  You do not need to change the later
modification to the file (i.e. "echo 2 >>a"), but only the above
single line change.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git can't merge two identical move file operation
  2006-11-16 11:32 ` Junio C Hamano
@ 2006-11-16 12:14   ` Alexander Litvinov
  2006-11-16 12:23   ` Alexander Litvinov
  2006-11-16 12:25   ` Alexander Litvinov
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Litvinov @ 2006-11-16 12:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

В сообщении от Thursday 16 November 2006 17:32 Junio C Hamano написал(a):
> Could you try an exactly the same sequence except to make the
> initial contents of the file 'a' a bit more meaningful (I
> typically use COPYING file in git.git repository for something
> like this), by replacing the above "echo 1 > a ..." line with:
>
> 	$ cat COPYING >a && git add a && git commit -a -m '1'
>
> and see if it still breaks?  You do not need to change the later
> modification to the file (i.e. "echo 2 >>a"), but only the above
> single line change.

Wow, that a magic ! It works !


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git can't merge two identical move file operation
  2006-11-16 11:32 ` Junio C Hamano
  2006-11-16 12:14   ` Alexander Litvinov
@ 2006-11-16 12:23   ` Alexander Litvinov
  2006-11-16 12:25   ` Alexander Litvinov
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Litvinov @ 2006-11-16 12:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

В сообщении от Thursday 16 November 2006 17:32 Junio C Hamano написал(a):
> Could you try an exactly the same sequence except to make the
> initial contents of the file 'a' a bit more meaningful (I
> typically use COPYING file in git.git repository for something
> like this), by replacing the above "echo 1 > a ..." line with:
>
> 	$ cat COPYING >a && git add a && git commit -a -m '1'
>
> and see if it still breaks?  You do not need to change the later
> modification to the file (i.e. "echo 2 >>a"), but only the above
> single line change.

Wow, that a magic ! It works !

Thanks for help.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git can't merge two identical move file operation
  2006-11-16 11:32 ` Junio C Hamano
  2006-11-16 12:14   ` Alexander Litvinov
  2006-11-16 12:23   ` Alexander Litvinov
@ 2006-11-16 12:25   ` Alexander Litvinov
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Litvinov @ 2006-11-16 12:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-16 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-16 10:26 Git can't merge two identical move file operation Alexander Litvinov
2006-11-16 11:32 ` Junio C Hamano
2006-11-16 12:14   ` Alexander Litvinov
2006-11-16 12:23   ` Alexander Litvinov
2006-11-16 12:25   ` Alexander Litvinov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).