git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Trouble merging renamed but identical files - CONFLICT (rename/rename)

From
Phil Hord <phil.hord@gmail.com>
Date
Jun 27, 2014, 21:46 UTC
Message-ID
<CABURp0rFCxxpiQhRYXmN5eBnKhyyOeuFSTj0V1tGZJSNea5iEA@mail.gmail.com>
In-Reply-To
<B901ECBC8F944F039AFD6B53929FF18C@black>
On Fri, Jun 27, 2014 at 4:47 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:
> There are two identical files from the same original parent, but both were
> renamed in their own branches. One branch moved the file to a new folder, the
> other renamed the file in the same folder.

You have not stated what you think the issue is. You have only stated the setup.

I suppose you want Git to merge without conflict in the end, though, based on your script. Is that right?

Show 10 quoted lines
> Steps to reproduce the issue:
> git init
> git fetch https://github.com/pdinc-oss/CipherShed.git
> git fetch https://github.com/srguglielmo/CipherShed.git
> git checkout -b test b60070f4d0879e277f44d174a163bbb292325fea
> git merge a0c84ff28f356bcb8b872a9c65a2e9bff97b3f68
>
> CONFLICT (rename/rename): Rename "TrueCrypt.sln"->"src/TrueCrypt.sln" in branch
> "HEAD" rename "TrueCrypt.sln"->"CipherShed.sln" in
> "a0c84ff28f356bcb8b872a9c65a2e9bff97b3f68"
Git seems to be doing the correct thing here.
Show 8 quoted lines
> git reset --hard b60070f4d0879e277f44d174a163bbb292325fea
> git mv src/TrueCrypt.sln src/CipherShed.sln
> git commit -m 'renamed to be congruent with a0c84ff'
> git merge a0c84ff28f356bcb8b872a9c65a2e9bff97b3f68
>
> Sill get a CONFLICT (rename/rename): Rename
> "TrueCrypt.sln"->"src/CipherShed.sln" in branch "HEAD" rename
> "TrueCrypt.sln"->"CipherShed.sln" in "a0c84ff28f356bcb8b872a9c65a2e9bff97b3f68"
Git seems to be doing the correct thing here, too.
> I will have many more to come, any suggestions?

Maybe you meant to move the renamed file to the same folder where it exists in the merge target. I do not get a conflict when I do that.

   git reset --hard b60070f4d0879e277f44d174a163bbb292325fea
   git mv src/TrueCrypt.sln CipherShed.sln
   git commit -m 'renamed to be congruent with a0c84ff'
   git merge a0c84ff28f356bcb8b872a9c65a2e9bff97b3f68
No conflict (on that file, anyway).

Regards, Phil

> This message is copyright PD Inc, subject to license 20080407P00.

p.s. Maybe you should remove this copyright threat in the future when you are writing to an open source community seeking help.

Previous: Jason PyeronNext: Jason Pyeron
Message 2 of 12 in “Trouble merging renamed but identical files - CONFLICT (rename/rename)”
  1. Jason PyeronJun 27, 2014
  2. Phil HordJun 27, 2014
  3. Jason PyeronJun 27, 2014
  4. Phil HordJun 29, 2014
  5. Jason PyeronJun 28, 2014
  6. Jason PyeronJun 28, 2014
  7. Phil HordJun 29, 2014
  8. Phil HordJun 29, 2014
  9. Jason PyeronJun 29, 2014
  10. Phil HordJun 29, 2014
  11. Jason PyeronJun 29, 2014
  12. Phil HordJun 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.