8 comments

Here is the article regarding that: https://www.jetbrains.com/help/idea/resolve-conflicts.html

Do you want to know something more exact? 

1

Thanks, Kostya for the quick reply. But could you please give more explanation for the following excerpt that I took from the link you provided:  "if the beginning and the end of the same line have been modified in different file revisions"

I'd appreciate it if you explained it by giving an example.

0

The logic is pretty simple, the same as git uses when auto-resolving. Git, however, operates with lines, and Resolve simple conflicts operates with words in the line.

So It compares a line from left and right on a by-word basis. If a word is changed only on one side, the change is applied to the result. If the word is changed on both sides - then it is not a simple conflict.

Let's illustrate with the example mentioned in the doc - if the beginning and the end of the same line have been modified in different file revisions.

The base revision: This is a simple conflict that can be resolved.
Revision 1: Below is a simple conflict that can be resolved.
Revision 2: This is a simple conflict that can be resolved automatically.
The difference between Revision 1 and base is the beginning - This change to Below. This part is not changed in revision 2.
The difference between Revision 2 and the base is the last word - automatically, which is not changed in revision 1.
So this can be merged into Below is a simple conflict that can be resolved automatically.

Hope this simple example explains the behavior.

4

Thank you, Dima, a lot. I wouldn't imagine that would be such a simple logic. Now it's all set.

0

I'd also like to understand this better.

Dmitry Smirnov your explanation is very clear, thank you.

What I'm wondering is: is there an equivalent git command, or is this something that the IDE is doing with its own logic?

Eg, is it passing something to git merge diff-algorithm=?

0

Hi Tim,
IDE communicates with your git exe and passes commands there.  Once you perform some VCS commands a console tab in your Git window will appear and you may see which commands are sent. 

0

> What I'm wondering is: is there an equivalent git command, or is this something that the IDE is doing with its own logic?

This is a feature of IDE. To the best of my knowledge, git does not have an equivalent. Diff-algorithm has a limited number of options and they affect how git operates lines.

1

Thanks! Its brilliant, and will keep using it :)

0

Please sign in to leave a comment.