From: "Shawn O. Pearce" <spearce@spearce•org>
To: Ted Pavlic <ted@tedpavlic•com>
Cc: git <git@vger•kernel.org>, Junio C Hamano <gitster@pobox•com>
Subject: Re: [PATCH 1/3] Purest update to bash completions to prevent unbounded variable errors.
Date: Tue, 13 Jan 2009 08:34:21 -0800 [thread overview]
Message-ID: <20090113163421.GQ10179@spearce.org> (raw)
In-Reply-To: <496CBC98.7090101@tedpavlic.com>
Ted Pavlic <ted@tedpavlic•com> 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@tedpavlic•com>
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@spearce•org>
> ---
> contrib/completion/git-completion.bash | 18 +++++++++---------
> 1 files changed, 9 insertions(+), 9 deletions(-)
--
Shawn.
next prev parent reply other threads:[~2009-01-13 16:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 16:08 [PATCH 1/3] Purest update to bash completions to prevent unbounded variable errors Ted Pavlic
2009-01-13 16:34 ` Shawn O. Pearce [this message]
2009-01-13 16:40 ` Ted Pavlic
2009-01-13 16:46 ` Shawn O. Pearce
2009-01-13 19:43 ` Junio C Hamano
2009-01-14 20:08 ` Ted Pavlic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090113163421.GQ10179@spearce.org \
--to=spearce@spearce$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=ted@tedpavlic$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox