[RFC] Ignoring versioned directory ignores all child files

John Arbash Meinel john at arbash-meinel.com
Fri Aug 25 19:05:28 BST 2006


https://launchpad.net/products/bzr/+bug/57637

Recently someone was trying to version their home directory, and wanted
to ignore all dot files, but have them versioned in a special sub-directory.

So after doing 'bzr ignore "./.*"' and then 'bzr add .dotfiles/', he
found that all of the files in '.dotfiles/' were defaulting to being
ignored.

He thought it was because they were also dot files, but really it is
because the full path to the files matches the regex. And this is
because fnmatch expands '*' => '.*' rather than '[^/]*' or something
equivalent.

So for a more obvious test, do this:

$ bzr init
$ mkdir foo
$ touch foo/bar
$ mkdir foo/baz
$ touch foo/baz/shizzle
$ bzr ignore "./fo*"
$ bzr add foo
added foo
ignored 2 file(s).

Now you can see that 'bar' and 'baz' are ignored by default.

So you can add them with:

$ bzr add foo/*
added foo/bar
added foo/baz
ignored 1 file(s).

But again 'foo/baz/shizzle' is ignored by default.

I think we need to look into using Jan's custom ignore creator, rather
than fnmatch. We already broke behavior between 0.8 and 0.9 (though we
tried to keep it fairly similar)

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060825/f96d8d66/attachment.pgp 


More information about the bazaar mailing list