Алексей Махоткин

домашняя страница

RFC: Let's Make Textual Conflicts More Personal

We’ve seen this pattern many times: you introduce version control to the team, and sooner or later someone encounters textual conflict. Less experienced users, such as HTML designers, copywriters, or even developers who are new to version control, tend to experience negative feelings, aimed towards Subversion and to you, by transitivity.

You carefully explain that all this time intelligent merging algorithm worked seamlessly, actually saving their time; that this is actual conflict between their changes and their colleague’s change. You track down that other person, and connect them both to work it out between them. They seem to agree, but I personally don’t have any illusion about what they think: that horrible “Subversion” beast patiently waited in its “repository”, and finally its time has come, and it mutilated their precious files with those horrible ”>>>>>>>” symbols, dealing irrevocable damage, destroying hours of work. And it is you who should have abolished the beast weeks ago, yet you seem to somehow collaborate with it. Something is wrong.

I think that the problem lies in anonymity of conflict markers. Subversion shows them like this:

— .svn/text-base/sandwich.txt.svn-base Tue Dec 11 21:33:57 2007 +++ .svn/tmp/tempfile.32.tmp Tue Dec 11 21:34:33 2007 @@ -1 +1,5 @@ -Just buy a sandwich. +<<<<<<< .mine +Go pick up a cheesesteak. +======= +Bring me a taco! +>>>>>>> .r32

Git shows them similarly. I propose that we add the necessary information about who did the change:

— .svn/text-base/sandwich.txt.svn-base Tue Dec 11 21:33:57 2007 +++ .svn/tmp/tempfile.32.tmp Tue Dec 11 21:34:33 2007 @@ -1 +1,5 @@ -Just buy a sandwich. +<<<<<<< .mine: DON'T PANIC. http://example.com/resolving.html +Go pick up a cheesesteak. +======= +Bring me a taco! +>>>>>>> .r32, added by mike at Tue Dec 07 11:00:00 2007

Of course, the information about who and when did the change is readily available from revision identifier, but the explanation could never hurt. It directs attention from the formless “Subversion”, or “Them”, to actual Mike, whom they could talk to. Second, the empty space could be used for some explanation, as set up by repository administrator.

If you like this idea – please, spread a word. Every version control system could be changed this way. And the change is almost purely cosmetic and I believe not very risky (though third-party tools could rely on conflict markers format too much).

What do you think?