Re: [PATCH 1/3] bash-completion: Support running when set -u is enabled

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

 



ted@xxxxxxxxxxxxx wrote:
> From: Ted Pavlic <ted@xxxxxxxxxxxxx>
> 
>   Under "set -u" semantics, it is an error to access undefined
>   variables. Some user environments may enable this setting 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.
> 
>   In this patch, functions that should always take an argument still use
>   $1. Functions that have optional arguments use ${1-}.
> 
> Signed-off-by: Ted Pavlic <ted@xxxxxxxxxxxxx>
> Acked-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>

Yup.  This patch isn't as bad as everyone made it out to be.
I think we should go ahead and include it.

But usually we don't indent the commit message like you did
above; instead the message should be aligned on the left margin at
column 0.  git log will indent the message during display, hence
any identation you add in the patch email just makes the message
that much harder to read from git log.

> ---
>  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