{"thread":{"id":"25572","subject":"[PATCH] completion: fix zsh check under bash with 'set -u'","startedAt":"2010-10-28T01:08:21Z","lastAt":"2010-10-28T13:51:54Z","messageCount":2,"participants":["Mark Lodato","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"154599","messageId":"1288228101-23000-1-git-send-email-lodatom@gmail.com","threadId":"25572","inReplyTo":null,"subject":"[PATCH] completion: fix zsh check under bash with 'set -u'","fromName":"Mark Lodato","fromEmail":"lodatom@gmail.com","sentAt":"2010-10-28T01:08:21Z","receivedAt":"2010-10-28T01:08:21Z","isPatch":true,"sender":{"key":"lodatom@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58860?v=4"},"body":"Commit 06f44c3 (completion: make compatible with zsh) broke bash\ncompatibility with 'set -u': a warning was generated when checking\n$ZSH_VERSION.  The solution is to supply a default value, using\n${ZSH_VERSION-}.  Thanks to SZEDER Gábor for the fix.\n\nSigned-off-by: Mark Lodato <lodatom@gmail.com>\n---\n contrib/completion/git-completion.bash |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 64341d5..168669b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2345,7 +2345,7 @@ _git ()\n {\n \tlocal i c=1 command __git_dir\n \n-\tif [[ -n $ZSH_VERSION ]]; then\n+\tif [[ -n ${ZSH_VERSION-} ]]; then\n \t\temulate -L bash\n \t\tsetopt KSH_TYPESET\n \tfi\n@@ -2394,7 +2394,7 @@ _git ()\n \n _gitk ()\n {\n-\tif [[ -n $ZSH_VERSION ]]; then\n+\tif [[ -n ${ZSH_VERSION-} ]]; then\n \t\temulate -L bash\n \t\tsetopt KSH_TYPESET\n \tfi\n@@ -2434,7 +2434,7 @@ complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \\\n \t|| complete -o default -o nospace -F _git git.exe\n fi\n \n-if [[ -n $ZSH_VERSION ]]; then\n+if [[ -n ${ZSH_VERSION-} ]]; then\n \tshopt () {\n \t\tlocal option\n \t\tif [ $# -ne 2 ]; then\n-- \n1.7.3.2\n"},{"id":"154630","messageId":"20101028135154.GC1877@neumann","threadId":"25572","inReplyTo":"1288228101-23000-1-git-send-email-lodatom@gmail.com","subject":"Re: [PATCH] completion: fix zsh check under bash with 'set -u'","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2010-10-28T13:51:54Z","receivedAt":"2010-10-28T13:51:54Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi Mark,\n\n\nOn Wed, Oct 27, 2010 at 09:08:21PM -0400, Mark Lodato wrote:\n> Commit 06f44c3 (completion: make compatible with zsh) broke bash\n> compatibility with 'set -u': a warning was generated when checking\n> $ZSH_VERSION.  The solution is to supply a default value, using\n> ${ZSH_VERSION-}.  Thanks to SZEDER Gábor for the fix.\n> \n> Signed-off-by: Mark Lodato <lodatom@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |    6 +++---\n>  1 files changed, 3 insertions(+), 3 deletions(-)\n\nThanks.  It works with bash and set -u, so if it works with zsh as\nwell, then I'm for it.\n\n\nWhile you are around, could you please have a look at this thread?\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/160103/focus=160135\n\n\nThanks,\nGábor\n"}]}