[RFC][PATCH] support for aliases in bazaar.conf

Erik Bågfors zindar at gmail.com
Sat Feb 11 08:03:14 GMT 2006


> > Anyway, the idea of aliases is nice, and it seems a little bit more
> > flexible than defaults. Though do you allow overriding a command with an
> > alias?
> > [ALIASES]
> > log = log -r -10..-1
>
> If we did this, it would seem to be a proper superset of what you can do
> with default options.  Aaron, would you be OK to use this instead?

There is no problem doing an alias like John describes, however,
because of the way it works, it's not a real replacement for defaults.

Alias works by expanding the command with the alias and rewriting argv
early in bzr.  So if you do "log -r-5..-1" and you have an alias as
described above, it will become "log -r-10..-1 -r-5..-1" and you will
get a "ERROR: repeated option" message back.  With defaults you
wouldn't get that.

This is very inspired by how shell aliases works:

: [bagfors at zyrgelkwyt]$ ; alias bl="bzr log -r-10..-1"
: [bagfors at zyrgelkwyt]$ ; bl -r-2..-1
bzr: ERROR: repeated option '-r-2..-1'

I like the simplicity in this, and I don't quite know how to solve
this, if it's something we should solve.

Regards,
Erik




More information about the bazaar mailing list