Shell completion scripts outdated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin von Gagern |
Bug Description
The shell completion scripts shipped with bzr are seriously outdated.
* contrib/
+ Completes command names.
+ Generates list of commands from bzr help invocation.
- No completion for built-in or user-configured aliases.
- No completion for options.
- Confused by global options preceding the bzr command name.
- Slow due to bzr invocation for list of commands.
OK, this isn't really outdated, it is only a bit too simple imho.
* contrib/bash/bzr from r620, 2005-06-02 (bzr-0.0.5)
+ Completes command names and options.
- Fixed list of commands and their options.
- A lot of recent commands and options are missing.
- All plugin commands are missing.
I guess this is installed by many distros, but it seems insufficient for practical use.
* contrib/zsh/_bzr from r331, 2005-05-03 (bzr-0.0.5)
+ Very verbose, including help texts for many completions.
+ Detailed handling of expected parameters in many cases.
- Fixed list of commands and their options.
- A lot of recent commands and options are missing.
- Some plugins are hardcoded into the list, whether they are installed or not.
- Slow due to bzr invocations for several types, e.g. versioned files.
It seems that zsh itself ships a slightly more recent version of this script.
Notice that none of these completions scripts uses the "bzr shell-complete" command.
Notice also that there is a bash_completion mode of tools/generate_
I know these completion scripts are contributed, and therefore probably not maintained officially. Nevertheless, I sometimes wonder whether dropping them might be better.
For bash, the bzr-bash-completion plugin I wrote (originally based on the contrib/bash/bzr script) gives reasonable flexibility and performance, in particular if using the lazy initialization of the completion function as employed by the lazy.sh script. So dropping the outdated scripts and replacing them with some reference to the completion plugin might be better. Users have requested my completion plugin to be included in bzr core. So I'm also offering the code for inclusion if you want it.
For zsh, even using the script shipped with recent versions of zsh is probably better than this outdated script in the bzr tree, so dropping it would seem prudent as well. I think there are also some scripts out there actually making use of the bzr shell-complete command, although this has a considerable impact on performance unless used with bzrc. I'm not using zsh, so I don't know if any of these might be a good candidate for inclusion.
Related branches
- Martin von Gagern (community): Disapprove
- Vincent Ladeuil: Approve
-
Diff: 456 lines (+17/-420)4 files modifiedcontrib/bash/README (+8/-0)
contrib/bash/bzr (+0/-104)
contrib/zsh/README (+9/-0)
contrib/zsh/_bzr (+0/-316)
- John A Meinel: Approve
- Vincent Ladeuil: Approve
-
Diff: 1273 lines (+1049/-132)8 files modifiedNEWS (+5/-0)
bzrlib/plugins/bash_completion/README.txt (+201/-0)
bzrlib/plugins/bash_completion/__init__.py (+39/-0)
bzrlib/plugins/bash_completion/bashcomp.py (+463/-0)
bzrlib/plugins/bash_completion/tests/__init__.py (+23/-0)
bzrlib/plugins/bash_completion/tests/test_bashcomp.py (+318/-0)
contrib/bash/bzr (+0/-104)
contrib/bash/bzr.simple (+0/-28)
- Robert Collins (community): Needs Fixing
-
Diff: 359 lines (+23/-316)3 files modifiedNEWS (+4/-0)
contrib/zsh/README (+19/-0)
contrib/zsh/_bzr (+0/-316)
Changed in bzr: | |
status: | Confirmed → Fix Released |
milestone: | none → 2.2b4 |
assignee: | nobody → Martin von Gagern (gagern) |
> I know these completion scripts are contributed, and therefore probably not maintained officially. Nevertheless, I sometimes wonder whether dropping them might be better.
I don't think we have (or should have) a category of in-the-tree but not maintained code for contrib. Probably much of what's currently in there should be reclassified as "examples" or "integration" or just deleted.
If you have looked into this and don't think there is value in shipping them, let's delete them. Would you like to put up a merge proposal?