There's a recent discussion thread about octopus merges on the main Git 
List that may be of interest 
https://lore.kernel.org/git/caoltt8s8rh+vycuaqbentmphirqw7hroplfpkxfntjq6bng...@mail.gmail.com/t/#u


On Friday, May 13, 2022 at 12:09:35 PM UTC+1 [email protected] 
wrote:

> (Of course I forgot to attach the attachment)
>
> On Friday, 13 May 2022 at 13:08:34 UTC+2 Johannes Lippmann wrote:
>
>> Hello, 
>>
>> I would like to merge multiple branches in one commit and resolve the 
>> merge conflicts by hand.
>> I was suprised to learn that this doesn't seem to be possible with git 
>> and am looking for a solution.
>>
>> My (simplified) situation is like this:
>>
>> I have a (python) project, versioned with git.
>> It's dependencies with versions are specified in a file called 
>> `pyproject.toml`.
>> There is also a file called `poetry.lock` which holds a lot of stuff, but 
>> also a hash over the project when the dependencies are installed.
>> Calculating this hash can only be done by really installing the packages, 
>> which is somewhat expensive (takes a view seconds).
>>
>> Then there is a bot (dependabot) which will update single packages on a 
>> new branch.
>> This changes both of the files mentioned above.
>> Let's say there are 3 of those dependabot branches: `update-dep-1`, 
>> `update-dep-2` and `update-dep-3`.
>> Now how should I merge them into main?
>>
>> Idea 1: I could merge them one by one. 
>> - `git merge update-dep-1` (no problems)
>> - `git merge update-dep-2` (merge conflict on `poetry.lock`, I have to 
>> regenerate this file)
>> - `git merge update-dep-3` (another merge conflict on `poetry.lock`, I 
>> have to regenerate this file)
>> As you see, I have to do the expensive recalculation n-1 times for n 
>> branches.
>> So this is not a nice workflow.
>>
>> Idea 2: I would like to do an octopus merge:
>> `git merge update-dep-1 update-dep-2 update-dep-3` (with single merge 
>> conflict)
>> I would then regenerate the `poetry.lock` once and be done with it.
>>
>> But unfortunatelly it seems that git wouldn't let me do an octopus merge 
>> where there are conflict.
>>
>> Fast-forwarding to: update-dep-1
>> Trying simple merge with update-dep-2
>> Simple merge did not work, trying automatic merge.
>> Auto-merging poetry.lock
>> ERROR: content conflict in poetry.lock
>> Auto-merging pyproject.toml
>> fatal: merge program failed
>> Automated merge did not work.
>> Should not be doing an octopus.
>> Merge with strategy octopus failed.
>>
>> Does anybody have an idea on how to make this work?
>> I would really like to hear your input on this.
>>
>> Yours,
>> Johannes
>>
>> PS: I have attached a small bash-script to build a minimal example of the 
>> problem,
>> run it in an empty directory.
>> (Of course review it before, you wouldn't run random bash scripts from 
>> strangers, would you?)
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/237f060e-c489-4593-b00b-44d5674de0f2n%40googlegroups.com.

Reply via email to