.bzrignore and bzr ignore are confusing (was Re: bzr commands taking a filename)
John Arbash Meinel
john at arbash-meinel.com
Fri Dec 9 14:54:01 GMT 2005
Michael Ellerman wrote:
> On Thu, 8 Dec 2005 19:54, Aaron Bentley wrote:
>> Martin Pool wrote:
>> | Saying --pattern 'foo*' might(?) help people remember they
>> | need to quote it too.
>>
>> I think they're independent. All entries may contain wildcards, whether
>> they're tree-wide or refer to a particular path.
>>
>> e.g.
>> subdir/*.pyc
>> (specific path, wildcard)
>>
>> Makefile
>> (tree-wide, no wildcard)
>
> Call me an idjiot, but I think .bzrignore and the bzr ignore command as they
> stand are a tad confusing.
>
> I see a few problems:
> - it's not clear how/if entries in .bzrignore apply to subdirectories.
> - it's not clear (given an empty .bzrignore) that you're looking at patterns
> - actually they're not patterns, they're globs.
> - bzr ignore has to be nasty about adding multiple files in order to catch
> the inadvertantly-expanded glob case.
> - I don't think it's obvious what this should do:
> # cd subdir
> # bzr ignore file-in-subdir
>
> I'm thinking out loud here but .. how about:
>
> 1. bzr ignore no longer exists, to ignore files you edit .bzrignore.
> 2. We change the format of .bzrignore to be more explicit.
> 3. bzr init creates a template .bzrignore with helpful comments.
>
> eg.
>
> # This file tells bzr which files to ignore in your working tree.
> # Entries in this file can be either file or path names, or patterns.
> # <short description of pattern syntax for newbies>
>
> [Global]
> # Entries in this section apply to your entire tree.
> # For example the following entry will cause all files in the tree
> # named "junk.o" to be ignored:
> # junk.o
>
> [Local]
> # Entries in this section only apply to files that match the full
> # path you specify. For example the following entry will cause all files
> # ending in .o in the directory "subdir" to be ignored:
> # subdir/*.o
>
> OK, maybe that's a bit hand-holdy, but I think we need to do something to make
> it more useable.
>
> cheers
>
-0
I don't think the format is all that bad as it stands. All entries are
globs. *all of them*. If there is no "/" in them, it will match just the
basename (filename), if there is a '/' then the pattern must match the
entire path.
I am happier about the earlier suggestion that if there is a '/' in the
path, then we need to add the local relative path on the beginning.
I think this is pretty clear
bzr ignore ./Makefile => ignore the Makefile in this directory only
bzr ignore Makefile => ignore Makefile in general
The only reason I see to use a parameter, is then it is more likely that
people will properly escape wildcards. One workaround to help people
would be to allow only 1 argument, and require people to do:
echo *.foo | xargs -n1 bzr ignore
I'm not a big fan of it, but I also don't think it is terrible.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051209/71c6bc46/attachment.pgp
More information about the bazaar
mailing list