[PATCH] stripping trailing slashes from ignore patterns (#4559)

Kent Gibson warthog618 at gmail.com
Wed Nov 1 13:50:49 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



John Arbash Meinel wrote:
>
>
> The changes look good to me, though. The only thing that doesn't seem to
> be tested is if you already have a rule with a trailing '/' in
> .bzrignore, it should still match files that patch the prefix.
>
> eg:
>   $ bzr init
>   $ echo "foo/" >> .bzrignore
>   $ touch foo
>   $ bzr ignored
>   foo    foo/
>
> I realize that people might be a little confused by that one, because we
> are ignoring the trailing slash.
>
Sorry - I hadn't considered that case.

Btw the old behaviour is that foo would not match foo/, independent of
whether foo is a file or directory.
The new behaviour is that it will ignore both.
However bzr ignored will return

foo   foo

not

foo foo/

since the slash is stripped as the pattern is read from .bzrignore,
not just when performing the matching.
So any confusion would only occur when looking for the "foo" pattern
in the .bzrignore and finding "foo/".
> Maybe it would be better to issue a warning if .bzrignore has a trailing
> slash in it, and then ignore it, rather than have people thinking it
> will only ignore a directory, or something like that.
Given that the old behaviour was for a foo/ pattern not to match
anything that probably should've been the way to go.
OTOH anyone who had a foo/ pattern in .bzrignore would've had to
manually edit it to drop the trailing slash or it wouldn't ignore
anything.  So there shouldn't be too many of them out in the wild.


Cheers,
Kent.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFSKY4goxTFTi1P8QRAqfTAKCpXir3dS8/xHCdknPIcNEN/v1L1gCgyWyl
CCQT9+9FNXjvplKF+iqDKr8=
=HONu
-----END PGP SIGNATURE-----




More information about the bazaar mailing list