Hacker News new | ask | show | jobs
by thaumasiotes 2335 days ago
I don't like the example. Unless I'm missing something, all three of these are exactly equivalent, so you could accept any of them as the result of a merge.

But the problem with that idea is that two different people explicitly made a change that looks meaningless. That tells us that we're evaluating "equivalent" incorrectly, which means we don't actually have any remaining justification for picking one over another, and the conflict is hopeless without further input.

1 comments

The correct merge, in my opinion would be D:

    add z w = z + w
My justification is that if you put each identifier on a separate line like this:

    fn add(
        x: i32,
        y: i32,
    ) -> i32 {
        x
        +
        y
    }
then as far as I know, Git would happily merge B and C into D.