On Thu, 7 Feb 2008, Karl Fogel wrote:
> John Peacock <john.peacock_at_havurah-software.org> writes:
>> I got involved in several discussion on users (which I know you don't
>> all read regularly) about changing the various "application/xml*"
>> types to be text by default, the longest of which is here:
>>
>> http://svn.haxx.se/users/archive-2008-02/0096.shtml
>>
>> I still believe that I'm right and that Subversion shouldn't have an
>> ever increasing set of exceptions enshrined in
>> svn_mime_type_is_binary() for all of eternity. I can pursue the
>> not-so-simple task of adding a new svn:text-type (a boolean flag) that
>> would override the normal MIME handling for purposes of diff/merge
>> only.
>>
>> It would only be a small patch to add a whole bunch of exceptions to
>> svn_mime_type_is_binary(). Is that the wiser course? Am I just being
>> a pedant and a crank to insist that because some XML files should be
>> treated as binary that we can't make that sort of overarching
>> assumption, just because it will help most people?
>
> I don't think we should add "exceptions" to svn_mime_type_is_binary().
> We should put mime types there that are known to be (almost always)
> texty; if people want files with other mime types to be treated as
> text, there should be a special property they can set.
>
> IOW, Subversion should do the right thing as often as possible without
> the user having to do anything special -- but the special thing should
> be available for those cases where the user knows something Subversion
> doesn't.
>
> We should think carefully about how this property solution would work.
> Instead of a simple boolean, let's think about what we need the
> information for:
>
> 1) Displaying diffs via diff2
> 2) Merging via diff3
> 3) Is there anything else...?
Yes, there are also files which are neither text nor binary, or maybe both
at the same time. I'm thinking about files like Winword files which can't
be diffed or merged now but they could if you coult startup Winword in
diff mode.
I'd like to propose a svn:diff-tool property with the two standard values
'text' and 'binary'. Other values could be looked up in the config file.
For example if the property value is 'winword' and the operation is 'diff'
it could read the entry 'winword-diff' from a section [tools]. Such an
entry should also support variable replacement to support diff tools with
different calling convention like:
text_diff = mytextdiff --file1 $1 --file2 $2
Just an idea to solve two things at once. Needs ofcourse a few more
thoughts.
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-08 00:03:14 CET