I haven't looked deeply into their algorithm. It's very possible it has
issues.

Sort of abstractly, the way I would approach it is:

1. Reconcile things to the pre merge state version of the files, so they
can be parsed. That would mean always pick incoming for one version and
always pick base for the other version.
2. Do a structured diff of the two structures to figure out what varied.
3. Generate one permutation of versions by using a set of heuristics. (e.g.
pick the newest, include additions, etc)
4. Then I would validate that the permutation is valid.
5. If it's valid, it's done, if it's not, go back to step 3, if all the
permutations were tried and none were valid, bail out.

Finally, if there are some edge cases that aren't handled, bail out and
state why.

This feels like something that doesn't need to be perfect from the
beginning. Just good enough.



Allen Madsen
http://www.allenmadsen.com

On Fri, Sep 8, 2017 at 8:10 AM, José Valim <[email protected]>
wrote:

> The tests in the PR seem to assume that:
>
> 1. HEAD comes first, which is not true for many Git workflows
> 2. That the conflict happens in separate packages
>
> It seems there has not been a discussion of all the possible corner cases.
>
> Further thoughts?
>
>
>
>
> *José Valim*
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R&D
>
> On Fri, Sep 8, 2017 at 4:38 AM, Allen Madsen <[email protected]>
> wrote:
>
>> I haven't looked too much myself, but this is the PR that added it.
>> https://github.com/yarnpkg/yarn/pull/3544/files
>>
>> Allen Madsen
>> http://www.allenmadsen.com
>>
>> On Thu, Sep 7, 2017 at 9:05 PM, José Valim <[email protected].
>> br> wrote:
>>
>>> That's an interesting feature. Does anyone have more information on how
>>> the merging actually works? Depending if you are rebasing or merging the
>>> direction on Git changes so it seems we can't simply pick what comes first
>>> or what comes later, can we?
>>> --
>>>
>>>
>>> *José Valim*
>>> www.plataformatec.com.br
>>> Skype: jv.ptec
>>> Founder and Director of R&D
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "elixir-lang-core" 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/ms
>>> gid/elixir-lang-core/CAGnRm4K7LCpnBqCh4f8L_TBmWEqh_6G575h3-L
>>> 24AYRzfB6SKg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4K7LCpnBqCh4f8L_TBmWEqh_6G575h3-L24AYRzfB6SKg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" 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/ms
>> gid/elixir-lang-core/CAK-y3CsJ1NPpYYbHHPZvpoWDgOg%3DibtrGxb3
>> b3%3DQ9R5E_6sGNQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3CsJ1NPpYYbHHPZvpoWDgOg%3DibtrGxb3b3%3DQ9R5E_6sGNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" 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/elixir-lang-core/CAGnRm4LwWgmWB_CwqOrib0RvaRVMy75EEuhQD8Rvot-
> NBkvZcQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LwWgmWB_CwqOrib0RvaRVMy75EEuhQD8Rvot-NBkvZcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" 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/elixir-lang-core/CAK-y3CsAkazsf3NiQ4krxVLNObUnbg9weYH_tRP-7u8YYqm1cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to