[PREVIEW] line-endings support

Alexander Belchenko bialix at ukr.net
Wed Apr 16 14:08:52 BST 2008


Martin Pool пишет:
> I was thinking about this the other day, and it seems that most of the
> options being discussed have a lot of overlap with our existing
> configuration system, and it would be nice to have only one rather than
> two, all else being equal.
> 
> We already have a way to define settings that apply globally, per user,
> per branch, per location (either recursively or not).  So, how about
> adding a concept to the configuration system that you can ask it to look
> up settings for a particular path, and they can match either the full path
> or a glob.  As a straw man maybe in ~/.bazaar/bazaar.conf
> 
>   [glob:*.py]
>   eol = native
> 
> I think eventually having these rules propagate to people who get
> checkouts of the tree is important, indeed the main point of them is to
> get consistent results when several people with different setups are
> working on the same project.  So, whatever mechanism we use, it has to get
> into the branch, and be carried around when you push, pull, etc.
> 
> If we specify these things as globs rather than as per-file properties we
> avoid some scaling problems of having O(n) lists.  Even quite large trees
> are likely to have modest numbers of different rules.

Your proposed approach with using globs everywhere instead of attaching
properties to file-ids will be much worse from performance point of view:
as I discover when I dogfooding my own work, id2path is *very* expensive
operation to use it frequently. And you will end up to using id2path
very often, because in many places there is only file-id without corresponding
path.

Of course bzrlib internals could be changed to provide faster solution.
Just don't forget about this.



More information about the bazaar mailing list