[RFC] Ignore lists
mbp at canonical.com
Thu Jul 6 03:10:16 BST 2006
On 5 Jul 2006, Jelmer Vernooij <jelmer at samba.org> wrote:
> At the moment, '.bzrignore' is a magic file containing the ignore list
> that is assumed to be present in every revision that has ignores.
> However, this file might not be present in all formats, as other formats
> might be using different ways of obtaining an ignore list.
> WorkingTree already contains a `get_ignore_list()' function that, in the
> default implementation, just reads .bzrignore but can be overridden to
> obtain the ignore list in some other way.
> It would be nice if the dependency on a `magic' file could be removed,
> to be able to support ignore lists from foreign branches. Instead, I
> think ignores should be in a control file and Repository should have a
> get_ignore_list(revid) function. CommitBuilder would have to have a
> set_ignore_list() function.
> The WorkingTree could use this function to obtain a list of ignores to
> write to its control file (.bzrignore or something else).
> I realize making the ignore list a control file would break the current
> format, but I think making the API changes can already be done.
There seem to be a couple of issues here.
Adding a Repository.get_ignore_list(revid), or (perhaps better?)
RevisionTree.get_ignore_list() seems fine and uncontroversial to me.
Eventually perhaps they will need to return some kind of smarter object
that can apply the rules in different ways consistent with the system
they're coming from, but we don't need to do that now.
Would you then propose to not store .bzrignore in the commit? It's
something that's purely managed by the working tree? (And different
working trees could potentially keep the list somewhere else?) That's
attractive in some ways - it removes the binding from how something is
presented to how its stored.
On the whole I like it - what do others think?
More information about the bazaar