monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] [PATCH] and RFC: binary files merging and hook


From: Joel Crisp
Subject: Re: [Monotone-devel] [PATCH] and RFC: binary files merging and hook
Date: Wed, 01 Jun 2005 22:06:01 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

I'm not against programming, just against making everyone do it. If you can 
provide a framework which allows a registry
of common file types against the way of handling them and a library of shipped code fragments which can be incorporated without the end user having to do any coding, then that would be fine.

Maybe something like:

monotone types filetype --match=\*.xml --type=text/xml    <--- Setup initial 
default mappings

or

monotone types filetype --file=foo.xml --type=x-rational-xmi         <--- 
Change the type of the file

Then have an object interface like (pseudocode!):

type_handlers {
   string[] getSupportedTypePatterns()
   void merge3(...args...)
   boolean isBinary()
   void copyIn(...stream..., ...database..., ..other args)
   void copyOut(..destination.., ..database..., ..other args)
   etc.
}

A library of type handlers which implemented this type of interface could then be selected at run-time simply by looking up the file type associated with file, then looking up the handler for that type. Note that there is no reason why these should not be lua if they are shipped as a standard library.

Whilst I take you point about user preference in merge tools, for many of the 'exotic' types there will be a much more limited set of merge tools and suppling type variants which are specific to each tool should be feasible.

Thoughts?

Joel



rghetta wrote:
On Wed, 2005-06-01 at 20:07 +0100, Joel Crisp wrote:

I just don't think that it is fair to expect everyone to program what should be 
standard functionality in hooks.

Hooks should be there for functionality which is non-standard, e.g. integration with "my" software process rather than yours...mailing when checkins are done, or enforcing lifecycle constraints.

Choosing how to handle common file types hardly fits into that category, and I think the average user would prefer that to be supported via a less obscure mechanism.

To give you some comparason: in a recent government job I worked in we weren't allowed to use triggers _at all_ (in clearcase, which uses perl) on the grounds that no-one else would be able to maintain them....let alone in a language with the limited uptake of lua (note, I personally think it is ok as a language, but the perception in the industry as a whole is that it is a game programmers language not a 'commercial' one)


Could you provide some example of an acceptable syntax ? How you like to specify merging behaviour, how to identify a filetype,
etc.
I really don't see how implement what you want without resorting to some
hook programming, unless we add a built-in filetype identifier. And even with something like that you need to handle the uncommon
filetype ...

Riccardo








_______________________________________________
Monotone-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monotone-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]