Thread (4 messages) 4 messages, 2 authors, 2016-06-15

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

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:45:56

Ted Pavlic [off-list ref] 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 <redacted>
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 <redacted>
---
 contrib/completion/git-completion.bash |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help