[RFC] handling files with weird names in .bzrignore
Martin Pool
mbp at canonical.com
Mon May 31 02:11:43 BST 2010
On 29 May 2010 22:21, Parth Malwankar <parth.malwankar at gmail.com> wrote:
> Hello,
>
> I started looking into a 'bzr ignore' bug[1] regarding handling
> filenames like "[". When we try to ignore such a file, bzr tries
> to interpret the name as a glob pattern and subsequently
> crashes inside Pythons re module. As the pattern is already
> in the file at this point, Doing 'bzr st' also crashes with the same
> error.
>
> There are at least two ways we could fix this:
>
> (1) Catch the exception and issue an error message indicating
> to the user that the given string is an invalid glob pattern
> and she should consider using "RE:" style python patterns
> and point to "bzr help patterns". "RE:\[" works fine in the case of
> this bug. We would need to ensure patterns are added to
> bzrignore only if they are valid.
Uh, \[ is a valid glob (isn't it?) that matches the filename [.
There's no need to change it to a re. Let's give a decent error, and
make sure that \[ works as it does in the shell.
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list