From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Ted Pavlic <ted@tedpavlic.com>,
Thomas Nilsson <thomas.nilsson@unixangst.com>,
git@vger.kernel.org
Subject: Re: [PATCH] bash-completion: Support running with set -u in bash 4.0
Date: Sat, 06 Mar 2010 11:29:54 -0800 [thread overview]
Message-ID: <7vtystfdu5.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20100306181655.GA2261@progeny.tock> (Jonathan Nieder's message of "Sat\, 6 Mar 2010 12\:16\:55 -0600")
Jonathan Nieder <jrnieder@gmail.com> writes:
> From: Thomas Nilsson <thomas.nilsson@unixangst.com>
> Date: Tue, 23 Feb 2010 12:13:00 +0100
>
> Starting with bash 4.0-beta, under "set -u" semantics, accessing
> undefined local variables is now an error. Some user environments
> enable this setting in the interactive shell, with unpleasant results:
Unfortunate but necessary, it seems.
> @@ -2181,7 +2181,7 @@ _git ()
> c=$((++c))
> done
>
> - if [ -z "$command" ]; then
> + if [ -z "${command-}" ]; then
> case "${COMP_WORDS[COMP_CWORD]}" in
> --*) __gitcomp "
> --paginate
Why not this patch, instead of the above hunk?
Also if we initialize __git_dir with an empty string on the same line, I
think we can lose "${__git_dir-}" ugliness in __gitdir () function.
contrib/completion/git-completion.bash | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index fe93747..3a65156 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2167,7 +2167,7 @@ _git_tag ()
_git ()
{
- local i c=1 command __git_dir
+ local i c=1 command="" __git_dir
while [ $c -lt $COMP_CWORD ]; do
i="${COMP_WORDS[c]}"
next prev parent reply other threads:[~2010-03-06 21:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-06 18:16 [PATCH] bash-completion: Support running with set -u in bash 4.0 Jonathan Nieder
2010-03-06 19:29 ` Junio C Hamano [this message]
2010-03-06 20:17 ` Jonathan Nieder
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=7vtystfdu5.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=spearce@spearce.org \
--cc=ted@tedpavlic.com \
--cc=thomas.nilsson@unixangst.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.