Hacker News new | past | comments | ask | show | jobs | submit login

Not sure if I like this better.

It seems even more complicated to track 3 context points in time rather than 2.

I'm open to changing my mind, but would need reasons. Botched rebases aren't a common issue for me (though merge conflict resolution can be unpleasant).




Oh, I love diff3. Having the common base (usually) makes it easier to see "what _change_ happened in the other branch", and "what _change_ happened in my branch". Then it's (usually) straight forward to apply one change to the other.

Of course, if seeing my code and their code works for you, then by all means keep doing what works.


I don't really feel comfortable without it. It seems imprudent not to know the common base.


You don't know the entire common base; only small windows of it where merge conflicts occurred. Elsewhere, a machine automatically merged it. That machine prudently had the common base, but didn't understand any of it.


The reason is that you have two chunks of code (possibly arbitrarily delimited).

You know from the regular two-part conflict marker that developer A wants the code one way, and B wants it some other way. Often that is quite easy to understand and resolve.

But sometimes it's useful to know the original: what is it that A and B started with, to produce those divergent sections of code?

That may be helpful.

It might not. For one thing, suppose the rest of the code merged. That means that in the rest of the code you don't see anything original.

You could end up with:

   <<<<<<<
   new_function_x();
   ========
   new_function_y();
   ||||||||
   function_that_no_longer_exists();
   >>>>>>>>
OK, the original was a function that no longer exists; and since this is the only conflict, you can't find that function anywhere unless you go digging into history out-of-band.

A and B both deleted the function, and that didn't conflict. Nice to know, but the definition of it isn't present to know what it does.

In other kinds of situations, it may be useful.


I don't see how there is any room for opinion. If you read the article, it opens with an example where it is impossible to determine the correct merge from the given information without diff3.


Bold of you to assume people read articles before commenting.

diff3 has another advantage in the general case as well since it allows you to better understand if something outside of the hunk you're applying also needs to be changed when backporting something.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: