* [PATCH] completion: fix zsh check under bash with 'set -u'
@ 2010-10-28 1:08 Mark Lodato
2010-10-28 13:51 ` SZEDER Gábor
0 siblings, 1 reply; 2+ messages in thread
From: Mark Lodato @ 2010-10-28 1:08 UTC (permalink / raw)
To: git; +Cc: SZEDER Gábor, Junio C Hamano
Commit 06f44c3 (completion: make compatible with zsh) broke bash
compatibility with 'set -u': a warning was generated when checking
$ZSH_VERSION. The solution is to supply a default value, using
${ZSH_VERSION-}. Thanks to SZEDER Gábor for the fix.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
---
contrib/completion/git-completion.bash | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 64341d5..168669b 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2345,7 +2345,7 @@ _git ()
{
local i c=1 command __git_dir
- if [[ -n $ZSH_VERSION ]]; then
+ if [[ -n ${ZSH_VERSION-} ]]; then
emulate -L bash
setopt KSH_TYPESET
fi
@@ -2394,7 +2394,7 @@ _git ()
_gitk ()
{
- if [[ -n $ZSH_VERSION ]]; then
+ if [[ -n ${ZSH_VERSION-} ]]; then
emulate -L bash
setopt KSH_TYPESET
fi
@@ -2434,7 +2434,7 @@ complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \
|| complete -o default -o nospace -F _git git.exe
fi
-if [[ -n $ZSH_VERSION ]]; then
+if [[ -n ${ZSH_VERSION-} ]]; then
shopt () {
local option
if [ $# -ne 2 ]; then
--
1.7.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] completion: fix zsh check under bash with 'set -u'
2010-10-28 1:08 [PATCH] completion: fix zsh check under bash with 'set -u' Mark Lodato
@ 2010-10-28 13:51 ` SZEDER Gábor
0 siblings, 0 replies; 2+ messages in thread
From: SZEDER Gábor @ 2010-10-28 13:51 UTC (permalink / raw)
To: Mark Lodato; +Cc: git, Junio C Hamano
Hi Mark,
On Wed, Oct 27, 2010 at 09:08:21PM -0400, Mark Lodato wrote:
> Commit 06f44c3 (completion: make compatible with zsh) broke bash
> compatibility with 'set -u': a warning was generated when checking
> $ZSH_VERSION. The solution is to supply a default value, using
> ${ZSH_VERSION-}. Thanks to SZEDER Gábor for the fix.
>
> Signed-off-by: Mark Lodato <lodatom@gmail.com>
> ---
> contrib/completion/git-completion.bash | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
Thanks. It works with bash and set -u, so if it works with zsh as
well, then I'm for it.
While you are around, could you please have a look at this thread?
http://thread.gmane.org/gmane.comp.version-control.git/160103/focus=160135
Thanks,
Gábor
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-28 13:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28 1:08 [PATCH] completion: fix zsh check under bash with 'set -u' Mark Lodato
2010-10-28 13:51 ` SZEDER Gábor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).