You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Sjoerd Tieleman <Sj...@phil.uu.nl> on 2005/11/11 18:14:59 UTC

Subversion conflict resolution

Hi all,

Can any of you tell me what the status is of the "Smart conflict  
resolution" in Subversion (as described in the Subversion design  
document: <http://subversion.tigris.org/files/documents/15/17/svn- 
design.html#Smart%20conflict%20resolution>)? At the moment it doesn't  
seem that there is any (or much) work on this subject done for  
Subversion, but I might be mistaken.
I am a student in Cognitive Artificial Intelligence at the Utrecht  
University, and I am currently preparing to write my masters thesis.  
At the moment, it looks like my thesis will touch a variety of  
subjects, including version control, structure-preserving merges  
(think of XML files, or more generally trees) and automatic conflict  
resolution (as one would want in a version control system).
If there hasn't been any work on this, would you happen to know  
places where one could find this kind of information (and if there  
even is interest in such a feature)?

Kind regards,

Sjoerd Tieleman.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Subversion conflict resolution

Posted by Julian Foad <ju...@btopenworld.com>.
Sjoerd Tieleman wrote:
> On 12-nov-2005, at 7:02, kfogel@collab.net wrote:
>> Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
>>
>>> Can any of you tell me what the status is of the "Smart conflict
>>> resolution" in Subversion (as described in the Subversion design
>>> document: <http://subversion.tigris.org/files/documents/15/17/svn-
>>> design.html#Smart%20conflict%20resolution>)?
>>
>> No work has been done as far as I'm aware.
> 
> But would there be any interest in such features in the Subversion client?

I think there would be a fair amount of interest in being able to do this from 
a Subversion client.  As Karl and Jim said, the diff and merge should be 
implemented in external programs, but users will see it as part of Subversion's 
capabilities, especially if the external program ends up being distributed as 
part of the Subversion package.

>  As I understood from Jim Blandy the functionality is just  there 
> to allow people to use their own scripts for interesting file  types. 

I would say the functionality is _not quite_ there.  There is no mechanism to 
do so conveniently and automatically, but the support is enough for development 
and experimental use, with ad-hoc work-arounds (such as not using the 
"svn:mime-type" property and guessing the type from the file name instead). 
For mainstream adoption, there is not really very much that needs to be done 
(the subject sparked a big debate about how MIME types should be used by 
Subversion itself, but I believe that can be side-stepped for this particular 
purpose), and there are enough interested people to do whatever is needed so 
you don't have to worry about implementing that side of it, in my opinion.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Subversion conflict resolution

Posted by Sjoerd Tieleman <Sj...@phil.uu.nl>.
On Nov 21, 2005, at 5:33 PM, kfogel@collab.net wrote:

> Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
>> So, this is kind of a bummer, because as I understand, Subversion  
>> sees
>> everything not marked as "text/*" as a binary file, and as such diff
>> tools are not called. So, this means that even if you specify in your
>> Subversion config file that your "special diff script" should  
>> always be
>> used, you are still left out in the cold for files with other types
>> (such as "application/xml"). So, for Subversion to be able to do  
>> this,
>> the hard-coded notion of not *ever* performing a diff/merge when  
>> we have
>> something other than "text/*" should have to be replaced with  
>> something
>> more elegent (which could be turned off by default and only turned on
>> by adding something to your config file, at the users discretion),  
>> but
>> which allows "experienced" users to perform diffs/merges on anything
>> other than text types.
>
> Yes, absolutely, this is a real problem.
>
> There was a huge discussion here recently about the right way to fix
> this, but after crawling around the archives for twenty minutes, I
> still can't find it :-(.  I must be searching on the wrong keywords;
> does anyone remember the thread?

[snip]

> Meanwhile, if you have time, you could perform a valuable service by
>
>    a) filing this as an issue (we don't seem to have one)
>    b) tracking down those mail threads and linking to them from the  
> issue

I've done the first part, it's filed under issue #2447. Someone  
should probably tweak the subcomponent and severity (seeing as this  
was my first issue report for Subversion). I'd be more than happy to  
discuss the possible resolutions/ideas/implementations, however, I'm  
not much of a programmer, so I probably can't fix them myself. :-)

Sjoerd.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Subversion conflict resolution

Posted by Sjoerd Tieleman <Sj...@phil.uu.nl>.
On Nov 22, 2005, at 3:08 PM, Julian Foad wrote:

> kfogel@collab.net wrote:
>> Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
>>> A quick search gives me some discussion from around July 2004:
>>>
>>> [ custom diff tools, a question is asked whether one can select a  
>>> diff
>>> tool based on the svn:mime-type property ]
>>> ***
>>> Branko Čibej:
>>>
>>> Yes, of course. The "diff tool" could be a script that looks at  
>>> the SVN
>>> file properties in the working copy (via "svn propget svn:mime- 
>>> type,"
>>> for example). However, note that this would work when explicitly  
>>> calling
>>> invoking "svn diff". It would _not_ magically make Subversion merge
>>> differences in binary files using your tool during "svn update",  
>>> because
>>> Subversion's notion of when a file is binary is hard-coded, and  
>>> if it
>>> thinks a file is binary, it won't invoke diff3 to do the merge.
>>> ***
>>>
>>> So, this is kind of a bummer, because as I understand, Subversion  
>>> sees
>>> everything not marked as "text/*" as a binary file, and as such diff
>>> tools are not called.
>> Yes, absolutely, this is a real problem.
>> There was a huge discussion here recently about the right way to fix
>> this, but after crawling around the archives for twenty minutes, I
>> still can't find it :-(.  I must be searching on the wrong keywords;
>> does anyone remember the thread?
>
> These are about calling generic "diff" programs but not about doing  
> so on non-text files:
>
>   2003-06-28 "help setting up Visual Diff"
>   2003-08-08 "Using an external diff program with Subversion"
>
> This is about calling an external diff3 for non-text files:
>
>   2005-07-11 "--diff3-cmd for binary files"
>
> These just discuss the status quo (no solutions):
>
>   2004-02-26 "visual diff"
>   2004-10-03 "--diff-cmd arguments"
>
> These proposed to add a separate config option for the diff arguments:
>
>   2003-06-30 "[PATCH] allow for default diff -x opts in config file"
>   2005-08-11 "[PATCH] add diff-cmd-args option to [helper] section."

This one is also related:

2004-7-30 "Textual binaries"
<http://svn.haxx.se/users/archive-2004-07/1692.shtml>

So I guess the correct thing to do would be to allow Subversion to  
have this internal list of MIME-types which it thinks is textual, but  
to allow this to be overridden by the user. Perhaps the notion of  
"textual" is a bit misleading, it could be rephrased. So, one might  
say the Subversion has an internal list of file types that are  
diffable in the traditional diff/patch way and allow the user to set  
the "svn:mime-type" property on special files and allow him in his  
config file to set diff/merge-tools for certain mime-types (perhaps  
even the Subversion internal diff, so you can give your file the  
correct MIME-type, but also have Subversion deal with it).
Karl, did you find those notes you mentioned earlier?

Sjoerd.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Subversion conflict resolution

Posted by Julian Foad <ju...@btopenworld.com>.
kfogel@collab.net wrote:
> Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
> 
>>A quick search gives me some discussion from around July 2004:
>>
>>[ custom diff tools, a question is asked whether one can select a diff
>>tool based on the svn:mime-type property ]
>>***
>>Branko Čibej:
>>
>>Yes, of course. The "diff tool" could be a script that looks at the SVN
>>file properties in the working copy (via "svn propget svn:mime-type,"
>>for example). However, note that this would work when explicitly calling
>>invoking "svn diff". It would _not_ magically make Subversion merge
>>differences in binary files using your tool during "svn update", because
>>Subversion's notion of when a file is binary is hard-coded, and if it
>>thinks a file is binary, it won't invoke diff3 to do the merge.
>>***
>>
>>So, this is kind of a bummer, because as I understand, Subversion sees
>>everything not marked as "text/*" as a binary file, and as such diff
>>tools are not called.
> 
> Yes, absolutely, this is a real problem.
> 
> There was a huge discussion here recently about the right way to fix
> this, but after crawling around the archives for twenty minutes, I
> still can't find it :-(.  I must be searching on the wrong keywords;
> does anyone remember the thread?

These are about calling generic "diff" programs but not about doing so on 
non-text files:

   2003-06-28 "help setting up Visual Diff"
   <http://svn.haxx.se/dev/archive-2003-06/1782.shtml>

   2003-08-08 "Using an external diff program with Subversion"
   <http://svn.haxx.se/users/archive-2003-08/0275.shtml>
   (Thread crosses over from "users" to "dev" list.)

This is about calling an external diff3 for non-text files:

   2005-07-11 "--diff3-cmd for binary files"
   <http://svn.haxx.se/dev/archive-2005-07/0408.shtml>

These just discuss the status quo (no solutions):

   2004-02-26 "visual diff"
   2004-10-03 "--diff-cmd arguments"

These proposed to add a separate config option for the diff arguments:

   2003-06-30 "[PATCH] allow for default diff -x opts in config file"
   2005-08-11 "[PATCH] add diff-cmd-args option to [helper] section."


>    a) filing this as an issue (we don't seem to have one)

Issue #2044: "Fully customizable external diff invocations"
   <http://subversion.tigris.org/issues/show_bug.cgi?id=2044>
   This is about the arguments passed to the diff, and it would be a good idea 
to tweak its summary to be explicitly about the arguments.

Issue #2447: "Support for external diff commands for non-text types"
   <http://subversion.tigris.org/issues/show_bug.cgi?id=2447>
   This is the one Sjoerd has just filed, about diffing non-text files, and 
preferably using different programs for different file types.

>    b) tracking down those mail threads and linking to them from the issue

I've just added the most relevant links.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Subversion conflict resolution

Posted by kf...@collab.net.
Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
> A quick search gives me some discussion from around July 2004:
> 
> [ custom diff tools, a question is asked whether one can select a diff
> tool based on the svn:mime-type property ]
> ***
> Branko Čibej:
> 
> Yes, of course. The "diff tool" could be a script that looks at the SVN
> file properties in the working copy (via "svn propget svn:mime-type,"
> for example). However, note that this would work when explicitly calling
> invoking "svn diff". It would _not_ magically make Subversion merge
> differences in binary files using your tool during "svn update", because
> Subversion's notion of when a file is binary is hard-coded, and if it
> thinks a file is binary, it won't invoke diff3 to do the merge.
> ***
> 
> So, this is kind of a bummer, because as I understand, Subversion sees
> everything not marked as "text/*" as a binary file, and as such diff
> tools are not called. So, this means that even if you specify in your
> Subversion config file that your "special diff script" should always be
> used, you are still left out in the cold for files with other types
> (such as "application/xml"). So, for Subversion to be able to do this,
> the hard-coded notion of not *ever* performing a diff/merge when we have
> something other than "text/*" should have to be replaced with something
> more elegent (which could be turned off by default and only turned on
> by adding something to your config file, at the users discretion), but
> which allows "experienced" users to perform diffs/merges on anything
> other than text types.

Yes, absolutely, this is a real problem.

There was a huge discussion here recently about the right way to fix
this, but after crawling around the archives for twenty minutes, I
still can't find it :-(.  I must be searching on the wrong keywords;
does anyone remember the thread?

I have some notes here from a discussion C. Michael Pilato and I had
about this a while go, in which we came to a complicated (but IIRC
sensible) conclusion about how to solve it.  I don't know whether our
conclusions matched those in the recent thread, unfortunately, because
I didn't follow the thread closely, and Mike's and my notes are over
in the office and I'm working from home today.

I'll try to get those notes when I next go in to the office, and post
them here, so they don't languish.

Meanwhile, if you have time, you could perform a valuable service by

   a) filing this as an issue (we don't seem to have one)
   b) tracking down those mail threads and linking to them from the issue

I think there was some reason why the obvious solution (always invoke
the external diff or diff3 program if the user named one, regardless
of the target's mime-type) had some problematic edge cases.  I can't
remember what those edge cases were though, and I might be totally
wrong about their existence, so if you want to throw that solution
into the issue as at least a first-draft proposal, that's fine.

Thanks for following up,
-Karl


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Subversion conflict resolution

Posted by Sjoerd Tieleman <Sj...@phil.uu.nl>.
On Nov 13, 2005, at 15:36 , kfogel@collab.net wrote:

> Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
>> On 12-nov-2005, at 7:02, kfogel@collab.net wrote:
>>
>> But would there be any interest in such features in the Subversion
>> client? As I understood from Jim Blandy the functionality is just
>> there to allow people to use their own scripts for interesting file
>> types. Also I understood from Garrett Rooney that the functionality
>> (using --diff-cmd and --diff3-cmd) is kind of "half-assed" and that
>> there is no mechanism (yet) to do "interesting" diffs/merges based on
>> mime-types (say: application/xml). Or perhaps this functionality
>> should be part of some third-party Subversion client and not in the
>> "official" Subversion client?
>
> I think the key line in Jim's document is:
>
>    Since all merging takes place on the client, these "smart merges"
>    should be implemented as a client-side plug-in.

[...]

> There have been some recent threads on the problems of --diff-cmd,
> --diff3-cmd, and Subversion's [mis]interpretation of svn:mime-type.  I
> don't have the thread URLs handy (sorry), but I think the place to
> start would be there, to see what, if anything, has already been
> analyzed.

A quick search gives me some discussion from around July 2004:

[ custom diff tools, a question is asked whether one can select a diff
tool based on the svn:mime-type property ]
***
Branko Čibej:

Yes, of course. The "diff tool" could be a script that looks at the SVN
file properties in the working copy (via "svn propget svn:mime-type,"
for example). However, note that this would work when explicitly calling
invoking "svn diff". It would _not_ magically make Subversion merge
differences in binary files using your tool during "svn update", because
Subversion's notion of when a file is binary is hard-coded, and if it
thinks a file is binary, it won't invoke diff3 to do the merge.
***

So, this is kind of a bummer, because as I understand, Subversion sees
everything not marked as "text/*" as a binary file, and as such diff
tools are not called. So, this means that even if you specify in your
Subversion config file that your "special diff script" should always be
used, you are still left out in the cold for files with other types
(such as "application/xml"). So, for Subversion to be able to do this,
the hard-coded notion of not *ever* performing a diff/merge when we have
something other than "text/*" should have to be replaced with something
more elegent (which could be turned off by default and only turned on
by adding something to your config file, at the users discretion), but
which allows "experienced" users to perform diffs/merges on anything
other than text types.

Sjoerd.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Subversion conflict resolution

Posted by kf...@collab.net.
Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
> On 12-nov-2005, at 7:02, kfogel@collab.net wrote:
> > Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
> >> Can any of you tell me what the status is of the "Smart conflict
> >> resolution" in Subversion (as described in the Subversion design
> >> document: <http://subversion.tigris.org/files/documents/15/17/svn-
> >> design.html#Smart%20conflict%20resolution>)? At the moment it doesn't
> >> seem that there is any (or much) work on this subject done for
> >> Subversion, but I might be mistaken.
> >
> > No work has been done as far as I'm aware.
> 
> But would there be any interest in such features in the Subversion
> client? As I understood from Jim Blandy the functionality is just
> there to allow people to use their own scripts for interesting file
> types. Also I understood from Garrett Rooney that the functionality
> (using --diff-cmd and --diff3-cmd) is kind of "half-assed" and that
> there is no mechanism (yet) to do "interesting" diffs/merges based on
> mime-types (say: application/xml). Or perhaps this functionality
> should be part of some third-party Subversion client and not in the
> "official" Subversion client?

I think the key line in Jim's document is:

   Since all merging takes place on the client, these "smart merges"
   should be implemented as a client-side plug-in.

So the problem is to identify the ways in which our current plugin
mechanism is not sufficient (which is probably related to Garrett's
statement about --diff-cmd and --diff3-cmd being "half-assed"), and
improve it.  That's all that should happen in Subversion itself, IMHO.
The actual implementation of the merge methods should happen
externally.

There have been some recent threads on the problems of --diff-cmd,
--diff3-cmd, and Subversion's [mis]interpretation of svn:mime-type.  I
don't have the thread URLs handy (sorry), but I think the place to
start would be there, to see what, if anything, has already been
analyzed.

Best,
-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Subversion conflict resolution

Posted by Sjoerd Tieleman <Sj...@phil.uu.nl>.
On 12-nov-2005, at 7:02, kfogel@collab.net wrote:

> Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
>> Can any of you tell me what the status is of the "Smart conflict
>> resolution" in Subversion (as described in the Subversion design
>> document: <http://subversion.tigris.org/files/documents/15/17/svn-
>> design.html#Smart%20conflict%20resolution>)? At the moment it doesn't
>> seem that there is any (or much) work on this subject done for
>> Subversion, but I might be mistaken.
>
> No work has been done as far as I'm aware.

But would there be any interest in such features in the Subversion  
client? As I understood from Jim Blandy the functionality is just  
there to allow people to use their own scripts for interesting file  
types. Also I understood from Garrett Rooney that the functionality  
(using --diff-cmd and --diff3-cmd) is kind of "half-assed" and that  
there is no mechanism (yet) to do "interesting" diffs/merges based on  
mime-types (say: application/xml). Or perhaps this functionality  
should be part of some third-party Subversion client and not in the  
"official" Subversion client?

Sjoerd.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Subversion conflict resolution

Posted by kf...@collab.net.
Sjoerd Tieleman <Sj...@phil.uu.nl> writes:
> Can any of you tell me what the status is of the "Smart conflict
> resolution" in Subversion (as described in the Subversion design
> document: <http://subversion.tigris.org/files/documents/15/17/svn-
> design.html#Smart%20conflict%20resolution>)? At the moment it doesn't
> seem that there is any (or much) work on this subject done for
> Subversion, but I might be mistaken.
> I am a student in Cognitive Artificial Intelligence at the Utrecht
> University, and I am currently preparing to write my masters thesis.
> At the moment, it looks like my thesis will touch a variety of
> subjects, including version control, structure-preserving merges
> (think of XML files, or more generally trees) and automatic conflict
> resolution (as one would want in a version control system).
> If there hasn't been any work on this, would you happen to know
> places where one could find this kind of information (and if there
> even is interest in such a feature)?

No work has been done as far as I'm aware.

Best,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org