Re: [PATCH 1/3] Purest update to bash completions to prevent unbounded variable errors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ted Pavlic <ted@xxxxxxxxxxxxx> wrote:
>
> First in a series of patches that make bash completions more robust to
> different interactive shell configurations and editors.
>
>
> Signed-off-by: Ted Pavlic <ted@xxxxxxxxxxxxx>

Your commit message leaves a lot to be desired.  I would instead
have written something like this:

  bash-completion: Support running when set -u is enabled

  Under set -u semenatics it is an error to access undefined
  variables.  Some user environments may enable this in the
  interactive shell.

  In any context where the completion functions access an undefined
  variable, accessing a default empty string (aka "${1-}" instead of
  "$1") is a reasonable way to code the function, as it silences
  the undefined variable error while still supplying an empty string.

Acked-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>

> ---
>  contrib/completion/git-completion.bash |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux