HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Peaker

no profile record

comments

Peaker
·il y a 9 ans·discuss
> In my experience conflicts are not "usually due to very wide, mechanical changes", they're due to two people modifying the same file at the same time.

Then it is likely a reversal of cause & effect. People are more reluctant to make wide sweeping changes such as renames because they're worried about the ensuing conflicts.

> Most projects don't go doing whitespace fixes over and over again

Again, for similar reasons. Projects limp around with broken indentation (tabs/spaces), trailing whitespaces, dos newlines, etc - because fixing whitespace is against policy. Why? Conflicts.

> You know what's even simpler? "Apply the same change to 1 version".

It sounds simpler, but not fucking it up is not simple at all, as evidenced by conflicts being a constant source of bugs.

When you look at the 3 versions, and "apply the diff to 1 version" you actually think you apply the diff to 1 version. You're applying the perceived diff to 1 version, which often differs from the actual diff as it may include subtle differences that aren't easily visible. This is detected by git-mediate the double-accounting of applying the perceived diff to both - validating that the perceived diff equals the actual diff.

Without git-mediate? At best you bring up build errors. At worst, revive old bugs that were subtly fixed in the diff you think you applied.

> then git-mediate just makes your job harder.

You're talking out of your ass here. Me and 20 other people have been using git-mediate and it's been a huge game changer for conflict resolution. Every single user I've talked to claims huge productivity/reliability benefits from using it.

> all you really need is a good merge tool

I've used "good" merge tools a lot. They're incredibly inferior to my favorite text editor:

* Text editing within them is tedious and terrible

* Their supported actions of copying whole lines from one version to the other are useless 90% of the time.

Let me ask you this:

What percentage of the big conflicts you resolve with a "good merge tool" - build & run correctly on the first run after resolution?

For git-mediate, that is easily >99%.
Peaker
·il y a 9 ans·discuss
> Since git-mediate can't actually tell if you applied the change to the other version correctly, you're getting no real benefit compared to just deleting the conflict markers yourself

This is patently and empirically false:

1) See the automated rename example. How do you gain the same safety and ease of resolution without git mediate? This is, unlike you say, an incredibly common scenario. After all, conflicts are usually due to very wide, mechanical changes. The exact kinds of changes that are easy to re-apply project-wide. It is true for not only renames, but also whitespace fixes which are infamous for causing conflicts and thus inserting bugs, and due to that are not allowed in many collaborative projects!

2) Instead of having to tediously compare the 3 versions to make sure you haven't missed any change when resolving (a very common error!) you now have to follow a simple guideline: Apply the same change to 2 versions.

This guideline is simple enough to virtually never fuck it up, unlike traditional conflict resolution which is incredibly error-prone. Your complaint that git mediate does not validate you followed this one guideline is moot, since this guideline is so easy to not fuck up - compared to the rest of the resolution process.

If you follow this guideline - git-mediate has tremendous value. It makes sure you did not forget any part of the change done by either side - and streamlines every other part of the conflict resolution process:

A) Takes my favorite editor directly to the conflict line

B) Shows me 2 diffs instead of 3 walls of text

C) Lets me choose the simpler diff to apply to the other sides, making a very minimal text change in my editor.

D) Validates that the change I applied was the last one (or decreases the size of the diff otherwise)

E) Does the "git add" for me, and takes me directly to the next conflict

This has been used by dozens of people, who can all testify that it:

A) Made conflict resolution easy and convenient

B) Reduced the error rate to zero (I don't remember the lasts bug inserted in a merge conflict)

C) Sped the process up by an order of magnitude
Peaker
·il y a 9 ans·discuss
Except you don't really know if you actually applied the full change to the other version. That's what applying it to the base is all about.

You often take the apparent diff, apply it to the other version, and then git-mediate tells you "oops, you forgot to also apply this change". And this is one of the big sources of bugs that stem from conflict resolutions.

Another nice thing about git-mediate is that it lets you safely do the conflict resolution automatically, e.g: via applying a big rename as I showed in the example, and seeing how many conflicts disappear. This is much safer than manually resolving.
Peaker
·il y a 9 ans·discuss
True, but if you follow a simple mechanical guideline: Apply the change 2 other versions (preferably the base one last) - then your conflict resolutions are going to be correct.

From experience with many developers using this method, conflict resolution errors went down to virtually zero, and conflict resolution time has improved by 5x-10x.
Peaker
·il y a 9 ans·discuss
That's why I showed an example of a rename. You write "manually fixed the conflict", where do you see that in the rename example?

You just re-apply either side of the changes in the conflict (Base->A, or Base->B) and the conflict is then detected as resolved. Reapplying (e.g: via automated rename) is much easier than what people typically mean by "manually resolving the conflict".

Also, as a pretty big productivity boost, it prints the conflicts in a way that lets many editors (sublime, emacs, etc) directly jump to conflicts, do the "git add" for you, etc. This converts your everyday editor into a powerful conflict resolution tool. Using the editing capabilities in most merge tools is tedious.
Peaker
·il y a 9 ans·discuss
When you have that many conflicts, it's often due to massive renames, or just code moves.

If you use git-mediate[1], you can re-apply those massive changes on the conflicted state, run git-mediate - and the conflicts get resolved.

For example: if you have 300 conflicts due to some massive rename, you can type in:

  git-search-replace.py[2] -f oldGlobalName///newGlobalName
  git-mediate -d
  Succcessfully resolved 377 conflicts and failed resolving 1 conflict.
  <1 remaining conflict shown as 2 diffs here representing the 2 changes>
[1] https://medium.com/@yairchu/how-git-mediate-made-me-stop-fea...

[2] https://github.com/da-x/git-search-replace
Peaker
·il y a 10 ans·discuss
Unfortunately, because of header files, no.
Peaker
·il y a 10 ans·discuss
Bummer. Oh well, at least typeof and compound expressions can be blessed?
Peaker
·il y a 11 ans·discuss
You're unlikely to know there's a problem and do so.

Rust is reminding you of this fact, which is very nice.
Peaker
·il y a 11 ans·discuss
IME, us "masochists" suffer much less in the end. We "suffer" a few seconds here and there when we get a compiler warning, forcing us to think edge cases through.

Then, later, we suffer much less through runtime debugging, QA, and get a lot less calls at 2AM.
Peaker
·il y a 11 ans·discuss
I don't know much Rust. But your comment just made me appreciate Rust a lot more!

To me, this signals that they value long-term safety over short-term convenience. Any other choice, IMO and IME, is short-sighted.