Re: [PATCH] Update bash completions to prevent unbound variable errors.
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jan 12, 2009, 21:31 UTC
- Message-ID
- <20090112213149.GL10179@spearce.org>
- In-Reply-To
- <200901121527.21818.bss@iguanasuicide.net>
"Boyd Stephen Smith Jr." <bss@iguanasuicide.net> wrote:
Show 5 quoted lines
> > Well, if the user want to run in "set -u" mode preventing it is bogus, IMO. > We could use subshells and unset at the top of _git and _gitk functions, that > would be only a +6/-4 patch. It would also not be something future > contributors have to think (much) about.
Running in subshells is a bad idea. We'd likely lose access to the completion word array, and it would take a lot longer per completion because you need to spin-up and tear-down that subshell.
We have spent some time to make the current completion code use as few forks as possible to get the results we want, because it runs faster that way.
-- Shawn.