0

I need a clarification about the meaning "Mergeable" within Subversion and about the way Subversion tries to merge contents.

In this answer to the question "Example of a change that is not a conflict", I read that :

"Line1" and "Line1changed" are not in conflict and "mergeable". In addition "Line1Changed" can replace "Line1".

Why?

In a programming Language this wouldn't make sense. For example :
int dummy=intVar

and

int dummy=intVar_

are not mergeable...(in my opinion), thus, could you please explain :

- Why These lines are mergeable?
- Why Subversion (I Use Tortoise SVN) try to automatically merge these lines WITHOUT prompting any warning? (I should be aware of it)

Thank you!

Community
  • 1
  • 1

1 Answers1

1

I'm not sure you read the answer carefully enough. What the answer says is that if a line is changed only on one side of a merge, then it can be merged automatically; if the same line is changed by more than one person, then you must handle the conflict (in one of several ways).

So in your example, if you start from

int dummy=intVar

And your neighbor changed the line to

int dummy=intVar_B

Then it will auto-merge the change because you had not changed this line; only your neighbor did. But if you start from

int dummy=intVar

And you change it to

int dummy=intVar_A

And your neighbor changed it to

int dummy=intVar_B

Then you would need to make a choice at merge time, choosing either their version of that line, or your version, or if you prefer, you could throw out both and make up a new version that somehow mixes them, or whatever is appropriate.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
  • Hi Dan, In the example it is intended "Safe" adding "something" to a line, but my question is :
    Why ADDING "Something" to a line is considered "safe" and made automatically without making the user aware of it? The changes taken by the "neighbour" could lead to something impredictable and out of control. it would be ok to merge its changes BUT Subversion should ask me for a confirmation. Where am I wrong? is there any option in SVN to avoid these automatic merging and make them to be managed by users as conflicts? Thank you all for your patience with a SVN newbie :)
    – Davide Porro Oct 18 '15 at 10:40
  • You're confusing the safety of a change with the software's capability of automatically merging it. Subversion will merge it because it can do that with no conflicts being generated. It isn't smart enough to know if the code is safe - it's assumed that question is answered by human review, automated testing, or whatever mechanism makes the most sense for your situation / team. – Dan Lowe Oct 18 '15 at 14:41