{"thread":{"id":"43330","subject":"Re: Git can't merge two identical move file operation","startedAt":"2006-11-16T10:26:37Z","lastAt":"2006-11-16T12:25:18Z","messageCount":5,"participants":["Junio C Hamano","Alexander Litvinov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"296226","messageId":"6e1787fe0611160226r2d51d980t6899f1a1018b5fe5@mail.gmail.com","threadId":"43330","inReplyTo":null,"subject":"Git can't merge two identical move file operation","fromName":"Alexander Litvinov","fromEmail":"litvinov2004@gmail.com","sentAt":"2006-11-16T10:26:37Z","receivedAt":"2006-11-16T10:26:37Z","isPatch":false,"sender":{"key":"litvinov2004@gmail.com","avatar":null},"body":"Hello,\n\nI have a git repo build using cvsimport. It has 'bad' directory\nstructure and I want to 'fix' it after each incremental update from\ncvs. Here is the idea: I have 2 permanent branches master (to work\nwith) and cvs (to import from cvs) and one temporary branch to move\nfiles across the project to make directory structure better. Movement\noperation is always the same: move directories/files from one place to\nanother. But merging from temp branch to work branch fail with error\ntext :\nCONFLICT (rename/delete): Rename a->b/a in HEAD and deleted in 791371\n\nHere is the example script:\n>git version\ngit version 1.4.4\n> mkdir 1 && cd 1 && git init-db\ndefaulting to local storage area\n> echo 1 > a && git add a && git commit -a -m '1'\nCommitting initial tree 2ce1eef76631e82282e0f7f0cf9e6f3e9a4a0b1e\n> git checkout -b fix\n> mkdir b && git mv a b/ && git commit -a -m 'fix 1'\n> git checkout -b work master\n> git pull . fix\nUpdating 7be4ab0..d4909bb\nFast forward\n a => b/a |    0\n 1 files changed, 0 insertions(+), 0 deletions(-)\n rename a => b/a (100%)\n> git checkout -f master\n> echo 2 >> a && git commit -a -m '2'\n> git checkout -b fix2 master\n> mkdir b && git mv a b/ && git commit -a -m 'fix 2'\n> git checkout -f work\n> git pull . fix2\nTrying really trivial in-index merge...\nfatal: Merge requires file-level merging\nNope.\nMerging HEAD with 791371d91c34bc45b289319d96ebf35c8be385a0\nMerging:\nd4909bb fix 1\n791371d fix 2\nfound 1 common ancestor(s):\n7be4ab0 1\nCONFLICT (rename/delete): Rename a->b/a in HEAD and deleted in\n791371d91c34bc45b289319d96ebf35c8be385a0\nAutomatic merge failed; fix conflicts and then commit the result.\n>\n\nBot fix and fix2 are temp branches and supposed to be deleted.\n\nWhy git can't merge such changes ? It should know that work holds\nrenamed version of file a from master and fix2 holds new renamed file\na from master too. Why it can't apply changes of a from master to work\n"},{"id":"294379","messageId":"7v1wo3bp99.fsf@assigned-by-dhcp.cox.net","threadId":"43330","inReplyTo":"6e1787fe0611160226r2d51d980t6899f1a1018b5fe5@mail.gmail.com","subject":"Re: Git can't merge two identical move file operation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-16T11:32:50Z","receivedAt":"2006-11-16T11:32:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alexander Litvinov\" <litvinov2004@gmail.com> writes:\n\n> Here is the example script:\n>>git version\n> git version 1.4.4\n>> mkdir 1 && cd 1 && git init-db\n> defaulting to local storage area\n>> echo 1 > a && git add a && git commit -a -m '1'\n> Committing initial tree 2ce1eef76631e82282e0f7f0cf9e6f3e9a4a0b1e\n\nCould you try an exactly the same sequence except to make the\ninitial contents of the file 'a' a bit more meaningful (I\ntypically use COPYING file in git.git repository for something\nlike this), by replacing the above \"echo 1 > a ...\" line with:\n\n\t$ cat COPYING >a && git add a && git commit -a -m '1'\n\nand see if it still breaks?  You do not need to change the later\nmodification to the file (i.e. \"echo 2 >>a\"), but only the above\nsingle line change.\n"},{"id":"295938","messageId":"200611161814.55755.litvinov2004@gmail.com","threadId":"43330","inReplyTo":"7v1wo3bp99.fsf@assigned-by-dhcp.cox.net","subject":"Re: Git can't merge two identical move file operation","fromName":"Alexander Litvinov","fromEmail":"litvinov2004@gmail.com","sentAt":"2006-11-16T12:14:55Z","receivedAt":"2006-11-16T12:14:55Z","isPatch":false,"sender":{"key":"litvinov2004@gmail.com","avatar":null},"body":"В сообщении от Thursday 16 November 2006 17:32 Junio C Hamano написал(a):\n> Could you try an exactly the same sequence except to make the\n> initial contents of the file 'a' a bit more meaningful (I\n> typically use COPYING file in git.git repository for something\n> like this), by replacing the above \"echo 1 > a ...\" line with:\n>\n> \t$ cat COPYING >a && git add a && git commit -a -m '1'\n>\n> and see if it still breaks?  You do not need to change the later\n> modification to the file (i.e. \"echo 2 >>a\"), but only the above\n> single line change.\n\nWow, that a magic ! It works !\n\n"},{"id":"298740","messageId":"200611161823.39056.litvinov2004@gmail.com","threadId":"43330","inReplyTo":"7v1wo3bp99.fsf@assigned-by-dhcp.cox.net","subject":"Re: Git can't merge two identical move file operation","fromName":"Alexander Litvinov","fromEmail":"litvinov2004@gmail.com","sentAt":"2006-11-16T12:23:38Z","receivedAt":"2006-11-16T12:23:38Z","isPatch":false,"sender":{"key":"litvinov2004@gmail.com","avatar":null},"body":"В сообщении от Thursday 16 November 2006 17:32 Junio C Hamano написал(a):\n> Could you try an exactly the same sequence except to make the\n> initial contents of the file 'a' a bit more meaningful (I\n> typically use COPYING file in git.git repository for something\n> like this), by replacing the above \"echo 1 > a ...\" line with:\n>\n> \t$ cat COPYING >a && git add a && git commit -a -m '1'\n>\n> and see if it still breaks?  You do not need to change the later\n> modification to the file (i.e. \"echo 2 >>a\"), but only the above\n> single line change.\n\nWow, that a magic ! It works !\n\nThanks for help.\n\n"},{"id":"295010","messageId":"6e1787fe0611160425l6ed76a5cncbb0236cbf0b5161@mail.gmail.com","threadId":"43330","inReplyTo":"7v1wo3bp99.fsf@assigned-by-dhcp.cox.net","subject":"Re: Git can't merge two identical move file operation","fromName":"Alexander Litvinov","fromEmail":"litvinov2004@gmail.com","sentAt":"2006-11-16T12:25:18Z","receivedAt":"2006-11-16T12:25:18Z","isPatch":false,"sender":{"key":"litvinov2004@gmail.com","avatar":null},"body":""}]}