The bug doesn't seem related to dotfiles specifically. I was able to reproduce the problem as:
$ bzr ignore './f*'
$ mkdir foo
$ touch foo/bar
$ bzr add foo
added foo
ignored 1 file(s).
If you wish to add some of these files, please add them by name.
So it seems our converter from globs to regex isn't probably ignoring the directory in the match.
It seems that because the pattern matches the parent directory, then all the files underneath that directory default to being ignored, even if the parent itself is versioned.
This stems from the fact that we use 'fnmatch.translate()' which translates '*' => '.*' rather than '[^/]*' or something like that.
So I would guess that we have had this bug for a long time, but never had someone who wanted to add files in a directory that would otherwise be ignored.
I certainly have versioned files that would have been ignored, and you can still use 'bzr add .dotfiles/*' to version all of the direct files. Or if you are using zsh, you cand do 'bzr add .dotfiles/**/*'
The bug doesn't seem related to dotfiles specifically. I was able to reproduce the problem as:
$ bzr ignore './f*'
$ mkdir foo
$ touch foo/bar
$ bzr add foo
added foo
ignored 1 file(s).
If you wish to add some of these files, please add them by name.
Also, this test fails: tests/workingtr ee_implementati ons/test_ is_ignored. py' tests/workingtr ee_implementati ons/test_ is_ignored. py 2006-07-21 04:02:14 +0000 tests/workingtr ee_implementati ons/test_ is_ignored. py 2006-08-25 01:16:27 +0000
self. assertEqual( None, tree.is_ignored(' xx'))
self. assertEqual( None, tree.is_ ignored( 'subdir/ xx '))
=== modified file 'bzrlib/
--- bzrlib/
+++ bzrlib/
@@ -77,6 +77,13 @@
+ def test_dotfile(self): branch_ and_tree( 'tree') tree_contents( [('tree/ .bzrignore' , './f*\n')]) l('./f* ', tree.is_ ignored( 'foo')) l(None, tree.is_ ignored( 'foo/bar' )) l(None, tree.is_ ignored( 'foo/.bar' )) ignored( self): branch_ and_tree( '.')
+ tree = self.make_
+ self.build_
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
+
def test_global_
tree = self.make_
The second one matches.
So it seems our converter from globs to regex isn't probably ignoring the directory in the match.
It seems that because the pattern matches the parent directory, then all the files underneath that directory default to being ignored, even if the parent itself is versioned.
This stems from the fact that we use 'fnmatch. translate( )' which translates '*' => '.*' rather than '[^/]*' or something like that.
So I would guess that we have had this bug for a long time, but never had someone who wanted to add files in a directory that would otherwise be ignored.
I certainly have versioned files that would have been ignored, and you can still use 'bzr add .dotfiles/*' to version all of the direct files. Or if you are using zsh, you cand do 'bzr add .dotfiles/**/*'