[PREVIEW] line-endings support
Ian Clatworthy
ian.clatworthy at canonical.com
Fri Apr 18 02:18:39 BST 2008
John Arbash Meinel wrote:
> The big problem I have with this is how to handle when a file matches
> multiple
> patterns. One clear example is absolute paths versus extensions (though
> generally you would say that the abspath would take precedence.)
>
> I can certainly create multiple rules that would match a single path. In
> that
> case, do they stack? Does one "win"? What are the rules for that (comes
> first
> alphabetically, comes first on the search list, comes last on the search
> list,
> matches more of the filename, etc.)
In the case of gitattributes, the doc is pretty clear:
* lower patterns in the file take precedence
* .gitattributes files have lower priority the further up the tree
they are.
Those rules look good to me.
> If we make the patterns *only* filename extensions *or* absolute paths,
> we can
> make some of the processing operations a lot faster. And you are a lot less
> likely to run into problems. But then what do you do about
> extension-less files
> (Makefile, configure, bzr, etc).
For consistency, I think we need to make the pattern language consistent
with .bzrignore (and see how that performs). In my current code, I think
the performance overhead ought to be next to non-existent if there are
no filters. Once we do have filters, I expect the overhead they
introduce to generally, but not always, swamp any increase we see in
pattern matching time to enable them.
Ian C.
More information about the bazaar
mailing list