FEATURE REQ: make bzr ignore accept multiple arguments

Jari Aalto jari.aalto at cante.net
Mon Sep 12 17:33:56 BST 2005


Aaron Bentley <aaron.bentley at utoronto.ca> writes:

| Jari Aalto wrote:
| 
| > This seemed like natural:
| > 
| >      $ bzr ignore '*.tmp' '*.bak' '*.rej' '*.orig'
| >      bzr: ERROR: extra argument to command ignore: *.bak
| > 
| > Hm? Please extend the command to accept multiple arguments.
| 
| The reason for that was the way glob expansion works in most shells.
| If you had, say foo.tmp and bar.tmp in your directory, then your shell
| would expand *.tmp to foo.tmp bar.tmp, and ignore only those two files.
|  So one easy way of detecting an accidental expansion is to refuse more
| than one argument.
| 
| Yes, we realize that you can quote '*.tmp'-- what we were trying to
| avoid was silently doing the wrong thing.

I don't think being overly protective is needed with this command. The
changes can be undone, since .bzrignore can be easily edited. Limiting
to do only one operation one at a time is expensive under Cygwin:

     bzr ignore A
     bzr ignore B
     bzr ignore C
     bzr ignore D

These process calls take about 10 seconds each before python fires up
in 450 Mhz PC. Total of 40 seconds before I could finish adding 4
ignore patterns. Same applies to scripted calls.

So, please allow multiple arguments. You can always do sanity checks:

    in case of user wrote

       bzr ignore *.tmp

    if files > 5 AND there is no wildcard '*' 
       print warning that user probably forgot to quote arg.
       But hey, do it anyway - user may know what he's doing.

| BTW, *.tmp, *.bak and *.orig are already in the default ignore list.

Good. please list them in the manual as well what are the defaults:

      $ bzr help ignore

And add also 

    *.rej 
    *.o         Object files
    *.elc       Emacs compile objects

if they are not there already.

Jari





More information about the bazaar mailing list