hraban / tomono

Multi- To Mono-repository merge
https://tomono.0brg.net
GNU Affero General Public License v3.0
842 stars 138 forks source link

Merging branches afer migration #21

Open calinvoichita opened 6 years ago

calinvoichita commented 6 years ago

Hi,

Thanks for the script, it works as expected. Had some issues with slashes in the branch names, but you guys fixed them in the mean time.

We've been using git flow in all our individual repos until now. After running the migration script, as expected we have master, develop, and a few feature/X branches. The problem comes when trying to finish one of the features (merge it do develop). Git seems to be very confused and throws a lot of conflicts. Some concrete examples include:

  1. develop contains a file, while feature/f1 has deleted it.
  2. develop contains a file, while feature/f1 has renamed it.
  3. small files with changes (this can be fixed with setting rename-threshold lower)

Trying to perform the same merge in the original repository shows no conflict. Based on my understanding, this issue arises because read-tree shows as an independent copy on each individual branch (develop and feature/f1).

Did anybody encounter this issue? Any recommendations?

Thanks, Calin

amrtn commented 6 years ago

I've encountered the same problem. Still investigating the issue.

Florent38 commented 6 years ago

Hi,

I've encountered the same problem. Did you find a workaround ?

Thanks, Florent

Strandfelt commented 6 years ago

I have the same issue. Did any of you have some luck with a workaround?

Florent38 commented 6 years ago

Yes, have a look at git subtree and specially -X option ;-) https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec

I have used tomono to create the monorepo for all develop branches and then use subtree merge to recreate old feature, release, hotfix, ... branchs on the new monorepo : git checkout develop git checkout -b git merge -X subtree= /

And it worked !

If you used tomono to create more than one branch, you won't be able to merge them in the future

babilog commented 2 years ago

We're running into the same issue with no clear fix. For instance, we have our master and develop branches, however, we can't seem to merge master into develop due to the CONFLICT (rename/delete) issue.

hraban commented 5 months ago

I had a look at this but I can't easily reproduce it. Do you have an example?

Here is a sample test script that seems to work OK: