> I've just filed bug 201935 about performance of bzr's bash completion,
> which can be improved drastically by using caching, i.e. write the
> output of e.g. "bzr s-c" into a bash variable and only fill it
> once. This saves quite some calls to "bzr" itself and therefor makes
> completion faster (and more compelling to use).
>
> Re "sed": you can replace e.g. "sed -nE 's/^([^[:space:]]+).*/\1/p'"
> with "grep -o ^([^[:space:]]+)".
like "bzr s-c | egrep -o '^([^:]+)'"? this is certainly possible.
> But please create the cache on the first call, not when the completion
> scripts get loaded (like git does it currently).
i can't do this either, because completions run in a subshell.
variables, like a cache, set in the subshell cease existing when that
subshell terminates. this is the reason git does some of the completion
work on loading.
then again, a few seconds after sending off this reply i might find
a way to transport results up one level of shell-invocations ...
but no sooner!
> Can you please create a branch for this, so it's easier to track
> status of this patch?
i'm afraid not. i don't use nor track bzr ATM.
should i find a solution to this problem, i'll have to send a patch.
> Daniel Hahler:
> I've just filed bug 201935 about performance of bzr's bash completion, [:space: ]]+).*/ \1/p'"
> which can be improved drastically by using caching, i.e. write the
> output of e.g. "bzr s-c" into a bash variable and only fill it
> once. This saves quite some calls to "bzr" itself and therefor makes
> completion faster (and more compelling to use).
>
> Re "sed": you can replace e.g. "sed -nE 's/^([^
> with "grep -o ^([^[:space:]]+)".
like "bzr s-c | egrep -o '^([^:]+)'"? this is certainly possible.
> But please create the cache on the first call, not when the completion
> scripts get loaded (like git does it currently).
i can't do this either, because completions run in a subshell.
variables, like a cache, set in the subshell cease existing when that
subshell terminates. this is the reason git does some of the completion
work on loading.
then again, a few seconds after sending off this reply i might find
a way to transport results up one level of shell-invocations ...
but no sooner!
> Can you please create a branch for this, so it's easier to track
> status of this patch?
i'm afraid not. i don't use nor track bzr ATM.
should i find a solution to this problem, i'll have to send a patch.
> Thank you!
thank you for the idea.
regards, clemens