{"thread":{"id":"30015","subject":"[PATCH v2] Fix git-completion.bash for use in zsh","startedAt":"2012-03-21T11:06:00Z","lastAt":"2012-04-07T13:09:35Z","messageCount":4,"participants":["Alex Merry","Junio C Hamano","Felipe Contreras"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"187387","messageId":"1332327960-5208-1-git-send-email-dev@randomguy3.me.uk","threadId":"30015","inReplyTo":null,"subject":"[PATCH v2] Fix git-completion.bash for use in zsh","fromName":"Alex Merry","fromEmail":"dev@randomguy3.me.uk","sentAt":"2012-03-21T11:06:00Z","receivedAt":"2012-03-21T11:06:00Z","isPatch":true,"sender":{"key":"dev@randomguy3.me.uk","avatar":null},"body":"zsh treats\n  local some_var=()\nas a function declaration, rather than an array declaration (although\nits documentation does not suggest that this should be the case).\n\nWith zsh 4.3.15 on Fedora Core 15, this causes\n  __git_ps1 \" (%s)\"\nto produce the message\n  local:2: command not found: svn_url_pattern\nwhen GIT_PS1_SHOWUPSTREAM=\"auto\", due to the line\n  local svn_remote=() svn_url_pattern count n\n\nSimply doing\n  local some_var\n  some_var=()\nfixes the issue.\n\nSigned-off-by: Alex Merry <dev@randomguy3.me.uk>\n---\n\nHere it is again, with a better commit message, and no whitespace issues (hopefully).\n\n\n contrib/completion/git-completion.bash |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 0acbdda..092a34f 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -94,8 +94,9 @@ __gitdir ()\n __git_ps1_show_upstream ()\n {\n \tlocal key value\n-\tlocal svn_remote=() svn_url_pattern count n\n+\tlocal svn_remote svn_url_pattern count n\n \tlocal upstream=git legacy=\"\" verbose=\"\"\n+\tsvn_remote=()\n \n \t# get some config options from git-config\n \tlocal output=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n-- \n1.7.6.5\n"},{"id":"187405","messageId":"7vaa393mvc.fsf@alter.siamese.dyndns.org","threadId":"30015","inReplyTo":"1332327960-5208-1-git-send-email-dev@randomguy3.me.uk","subject":"Re: [PATCH v2] Fix git-completion.bash for use in zsh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-21T17:05:59Z","receivedAt":"2012-03-21T17:05:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Merry <dev@randomguy3.me.uk> writes:\n\n> zsh treats\n>   local some_var=()\n> as a function declaration, rather than an array declaration (although\n> its documentation does not suggest that this should be the case).\n>\n> With zsh 4.3.15 on Fedora Core 15, this causes\n>   __git_ps1 \" (%s)\"\n> to produce the message\n>   local:2: command not found: svn_url_pattern\n> when GIT_PS1_SHOWUPSTREAM=\"auto\", due to the line\n>   local svn_remote=() svn_url_pattern count n\n\nThanks, will queue.  Felipe, comments?\n\n> Simply doing\n>   local some_var\n>   some_var=()\n> fixes the issue.\n>\n> Signed-off-by: Alex Merry <dev@randomguy3.me.uk>\n> ---\n>\n> Here it is again, with a better commit message, and no whitespace issues (hopefully).\n>\n>\n>  contrib/completion/git-completion.bash |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 0acbdda..092a34f 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -94,8 +94,9 @@ __gitdir ()\n>  __git_ps1_show_upstream ()\n>  {\n>  \tlocal key value\n> -\tlocal svn_remote=() svn_url_pattern count n\n> +\tlocal svn_remote svn_url_pattern count n\n>  \tlocal upstream=git legacy=\"\" verbose=\"\"\n> +\tsvn_remote=()\n>  \n>  \t# get some config options from git-config\n>  \tlocal output=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n"},{"id":"187686","messageId":"CAMP44s3_aZ39n6L15ZUNyw8B_6ab+=_Hm8-KPz6WM26GweJCmg@mail.gmail.com","threadId":"30015","inReplyTo":"7vaa393mvc.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] Fix git-completion.bash for use in zsh","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-03-25T17:47:45Z","receivedAt":"2012-03-25T17:47:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Mar 21, 2012 at 7:05 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Alex Merry <dev@randomguy3.me.uk> writes:\n>\n>> zsh treats\n>>   local some_var=()\n>> as a function declaration, rather than an array declaration (although\n>> its documentation does not suggest that this should be the case).\n>>\n>> With zsh 4.3.15 on Fedora Core 15, this causes\n>>   __git_ps1 \" (%s)\"\n>> to produce the message\n>>   local:2: command not found: svn_url_pattern\n>> when GIT_PS1_SHOWUPSTREAM=\"auto\", due to the line\n>>   local svn_remote=() svn_url_pattern count n\n>\n> Thanks, will queue.  Felipe, comments?\n\nLooks good to me. Also, I tested this, and it worked.\n\n-- \nFelipe Contreras\n"},{"id":"188732","messageId":"CAMP44s1H74_2pewqLrkz9cmiguxH1=Ayz-5fn5_HgUCqbbB9rw@mail.gmail.com","threadId":"30015","inReplyTo":"1332327960-5208-1-git-send-email-dev@randomguy3.me.uk","subject":"Re: [PATCH v2] Fix git-completion.bash for use in zsh","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-04-07T13:09:35Z","receivedAt":"2012-04-07T13:09:35Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Mar 21, 2012 at 1:06 PM, Alex Merry <dev@randomguy3.me.uk> wrote:\n\n>  __git_ps1_show_upstream ()\n>  {\n>        local key value\n> -       local svn_remote=() svn_url_pattern count n\n> +       local svn_remote svn_url_pattern count n\n>        local upstream=git legacy=\"\" verbose=\"\"\n> +       svn_remote=()\n>\n>        # get some config options from git-config\n>        local output=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n> --\n\nActually, a more proper way to do this is 'local -a svn_remote'.\n\nCheers.\n\n-- \nFelipe Contreras\n"}]}