[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

special property for text types (was: RFC: Am I being a hardass?)

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Thu, 07 Feb 2008 12:51:55 -0500

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...?

Is one knob enough to indicate all the things we need to indicate? Is
it always the case that (1) and (2) travel together? If so, a boolean
'svn:is-text' property would be enough. But the things we need to
indicate might be disjoint, in which case either multiple properties
or one property with multiple possible values may be needed.

(Note: don't use "svn:text-type" for the name -- people would think it
works the way "svn:mime-type" does, i.e., that they'd have to specify
one of a bazillion "text types" as the value.)

-Karl

---------------------------------------------------------------------
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-07 18:52:10 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.