Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: Merge mode (Was Classifying files as binary or text)

subversion
Discussion topic

Back to topic list

Re: Merge mode (Was Classifying files as binary or text)

Author julianfoad
Full name Julian Foad
Date 2009-11-18 02:54:06 PST
Message B. Smith-Mannschott wrote:
> After many years of using Subversion, I've come to the conclusion that
> svn:mime-type is best understood as a way to keep Apache happy and
> able to support read-only repository browsing. The fact that this
> property is also used to determine ability to merge, diff, and blame
> is an unfortunate wart.

Ah, yes, it is illogical to design the system such that mergeability
shall be determined from the MIME type alone. That is certainly not, and
never can be, a 100% indicator of mergeability.

I think there are two issues here.

(1) Subversion's MIME type recognition is severely deficient (lots of
common textual types not recognized), causing the use of MIME type for
this purpose to be seen as a poor choice of design. Would you ever have
considered it a "wart" if all registered MIME types were recognized so
that the current mechanism worked well in nearly all cases?

(2) MIME type can never be a 100% indicator of line-based text, much
less of line-wise mergability. It is just a useful clue that can get us
maybe 98% there. To get 100% there, other indicators are needed too,
including a way to independently and specifically indicate
blame/diff/merge behaviour to Subversion.


Here is a vision of a solution that doesn't treat MIME-type as "special"
but can still take advantage of it, both for 99% "Do The Right Thing"
without manual setting of another property, and also for backward
compatibility.

(1) Use of line-wise merge shall be determined by a set of rules of the
following kinds:

    * a specified property not existing, or existing and its value
matching a specified pattern

    * the file name matching a specified pattern

    * a content scan determining whether the content is predominantly
plain text

The rules for combining the rules are (something straight-forward, to be
decided).

The rules can be written to match svn:mime-type and svn:merge-mode, thus
achieving the best results that mime-type matching can provide and yet
also the explicit setting when it is wanted.

(2) Use of line-wise diff shall be determined by a set of rules of the
above kinds.

(3) Use of line-wise blame shall be determined by a set of rules of the
above kinds.

(4) Default rules should be supplied.

(5) The rules can be customised in the client's config. (Not that
client-side config is ideal, but that's the kind of config we have and
it is manageable.)

(6) The other issue is whether to store the results of that
determination in versioned properties on the file (svn:merge-mode,
svn:diff-mode, svn:blame-mode). If we leave the determination till run
time, then a client that has a better merge (or diff or blame) tool for
certain file types will be able to use it.

- Julian

« Previous message in topic | 17 of 30 | Next message in topic »

Messages

Show all messages in topic

Merge mode (Was Classifying files as binary or text) mikesamuel Mike Samuel 2009-11-17 12:56:44 PST
     Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-17 13:09:23 PST
         Re: Merge mode (Was Classifying files as binary or text) mikesamuel Mike Samuel 2009-11-17 13:33:29 PST
             Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-17 15:19:01 PST
                 Re: Merge mode (Was Classifying files as binary or text) mf Martin Furter 2009-11-17 16:19:02 PST
                     Re: Merge mode (Was Classifying files as binary or text) mikesamuel Mike Samuel 2009-11-17 17:57:42 PST
                         Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-17 23:38:46 PST
     Re: Merge mode (Was Classifying files as binary or text) markphip Mark Phippard 2009-11-17 13:35:01 PST
     Re: Merge mode (Was Classifying files as binary or text) bpsm B. Smith-Mannschott 2009-11-17 13:46:19 PST
         Re: Merge mode (Was Classifying files as binary or text) mikesamuel Mike Samuel 2009-11-17 13:48:06 PST
     Re: Merge mode (Was Classifying files as binary or text) julianfoad Julian Foad 2009-11-17 19:05:36 PST
         Re: Merge mode (Was Classifying files as binary or text) mikesamuel Mike Samuel 2009-11-17 20:23:40 PST
             Re: Merge mode (Was Classifying files as binary or text) julianfoad Julian Foad 2009-11-18 03:10:00 PST
         Re: Merge mode (Was Classifying files as binary or text) glasser David Glasser 2009-11-17 23:26:07 PST
             Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-17 23:44:23 PST
             Re: Merge mode (Was Classifying files as binary or text) bpsm B. Smith-Mannschott 2009-11-18 00:47:44 PST
                 Re: Merge mode (Was Classifying files as binary or text) julianfoad Julian Foad 2009-11-18 02:54:06 PST
                     Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-19 00:34:59 PST
         Re: Merge mode (Was Classifying files as binary or text) julianfoad Julian Foad 2009-11-18 02:55:21 PST
             Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-18 03:16:17 PST
                 Re: Merge mode (Was Classifying files as binary or text) julianfoad Julian Foad 2009-11-18 03:31:48 PST
                     Re: Merge mode (Was Classifying files as binary or text) brane Branko Cibej 2009-11-18 03:43:47 PST
             Re: Merge mode (Was Classifying files as binary or text) bpsm B. Smith-Mannschott 2009-11-18 03:31:31 PST
                 Re: Merge mode (Was Classifying files as binary or text) markphip Mark Phippard 2009-11-18 05:22:15 PST
                     Re: Merge mode (Was Classifying files as binary or text) julianfoad Julian Foad 2009-11-18 07:27:36 PST
Page: of 2 « Previous | Next »
Messages per page: