RFC: handling of ignore files
Jason Diamond
jason at injektilo.org
Sun Mar 27 19:31:12 BST 2005
On Sun, 2005-03-27 at 19:07 +1000, Martin Pool wrote:
> If there needs to be a way to turn them off, then how should that be
> done? One way is to have 'bzr init' create a default .bzrignore file,
> which means it is simple to see how to remove patterns. This is also
> consistent with tla, fwiw. But it is perhaps a bit distasteful to
> create files within the working directory.
Does this mean that every directory will have .bzrignore file in it?
Being able to ignore files that match this pattern in the current
directory and all of the descendant directories would be extremely
useful. And it seems like that's what the default ignore list is doing
(starting from the root of the tree) so why not combine the two concepts
into one?
If we're allowed to add ignore directives that work down the tree, we're
going to need to remove them, of course. And if we can remove ours at
arbitrary locations, why not be able to remove the defaults, too?
Here's some examples:
*.foo
That does exactly what CVS/SVN users expect it to--ignore files that
match *.foo in the current directory only.
+ *.foo
Ignore files matching *.foo in the current directory and all of the
descendant directories. We can pretend that the parent directory of the
root of all working trees contains a .bzrignore file with all of the
default patterns prefixed with these "+ " indicators so they're active
for the entire tree.
- *.foo
"Turns off" the ignoring of files matching *.foo in the current
directory and all of the descendant directories (until turned on again).
So if we don't like the defaults, we can just turn off the ones we don't
like in the root of our working tree. Turning off the defaults and
turning off our own patterns use the same syntax and probably the same
code so it should be nice and consistent for the users and the developer
(you).
-- Jason
More information about the bazaar
mailing list