From: Felipe Contreras Date: Mon, 30 Jan 2012 03:39:20 GMT Subject: Re: [PATCH] completion: cleanup __gitcomp* Message-ID: In-Reply-To: <20120130024242.GA15896@burratino> On Mon, Jan 30, 2012 at 4:42 AM, Jonathan Nieder wrote: > Felipe Contreras wrote: > >>  * ${1-} is the same as $1 > > | $ git log -S'${1-}' contrib/completion/git-completion.bash > | [...] > | commit 25a31f81 > | Author: Ted Pavlic > | Date:   Thu Jan 15 11:02:21 2009 -0500 > | > |     bash-completion: Support running when set -u is enabled > | > |     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 > |     Acked-by: Shawn O. Pearce > |     Signed-off-by: Junio C Hamano > > Hope that helps, I see. I'll revert that then. -- Felipe Contreras