{"thread":{"id":"28276","subject":"[PATCH] Fix git-completion.bash for use in zsh","startedAt":"2011-09-01T13:47:31Z","lastAt":"2012-03-20T18:20:08Z","messageCount":4,"participants":["Alex Merry","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"174668","messageId":"4E5F8CF3.3060304@randomguy3.me.uk","threadId":"28276","inReplyTo":null,"subject":"[PATCH] Fix git-completion.bash for use in zsh","fromName":"Alex Merry","fromEmail":"dev@randomguy3.me.uk","sentAt":"2011-09-01T13:47:31Z","receivedAt":"2011-09-01T13:47:31Z","isPatch":true,"sender":{"key":"dev@randomguy3.me.uk","avatar":null},"body":"Certain versions (or option combinations) of zsh appear to treat\nthings like\nlocal some_var=()\nas a function declaration.  This makes errors appear when using it in\ncombination with the GIT_PS1_SHOWUPSTREAM option.\n\nSigned-off-by: Alex Merry <dev@randomguy3.me.uk>\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 5a83090..89de45d 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -106,8 +106,9 @@ __gitdir ()\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        while read key value; do\n-- \n1.7.6\n"},{"id":"187321","messageId":"4F686FA2.8070803@randomguy3.me.uk","threadId":"28276","inReplyTo":"4E5F8CF3.3060304@randomguy3.me.uk","subject":"Re: [PATCH] Fix git-completion.bash for use in zsh","fromName":"Alex Merry","fromEmail":"kde@randomguy3.me.uk","sentAt":"2012-03-20T11:53:06Z","receivedAt":"2012-03-20T11:53:06Z","isPatch":true,"sender":{"key":"kde@randomguy3.me.uk","avatar":null},"body":"This is just a reminder message, since I haven't heard anything back on \nthis, and it hasn't made its way into the repo.\n\nI realise Felipe Contreras has been pushing a different approach to \nmaking it work properly in zsh, but this should be a fairly innocuous \nfix in the meantime.\n\nAlex\n\nOn 01/09/11 14:47, Alex Merry wrote:\n> Certain versions (or option combinations) of zsh appear to treat\n> things like\n> local some_var=()\n> as a function declaration.  This makes errors appear when using it in\n> combination with the GIT_PS1_SHOWUPSTREAM option.\n>\n> Signed-off-by: Alex Merry<dev@randomguy3.me.uk>\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 5a83090..89de45d 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -106,8 +106,9 @@ __gitdir ()\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>          while read key value; do\n"},{"id":"187334","messageId":"7vr4wn6y2k.fsf@alter.siamese.dyndns.org","threadId":"28276","inReplyTo":"4F686FA2.8070803@randomguy3.me.uk","subject":"Re: [PATCH] Fix git-completion.bash for use in zsh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-20T16:23:31Z","receivedAt":"2012-03-20T16:23:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Merry <kde@randomguy3.me.uk> writes:\n\n> This is just a reminder message, since I haven't heard anything back\n> on this, and it hasn't made its way into the repo.\n> I realise Felipe Contreras has been pushing a different approach to\n> making it work properly in zsh, but this should be a fairly innocuous\n> fix in the meantime.\n\nThanks.\n\n\"git grep 'local .*=('\" tells me that there is only one such construct;\nthere is another hit but it is not an empty array \"=()\" but that assigns\n\"=($(some command output))\" so presumably zsh does not mistake it for a\ndeclaration.\n\nFelipe, any comments?\n>\n> Alex\n>\n> On 01/09/11 14:47, Alex Merry wrote:\n>> Certain versions (or option combinations) of zsh appear to treat\n>> things like\n>> local some_var=()\n>> as a function declaration.  This makes errors appear when using it in\n>> combination with the GIT_PS1_SHOWUPSTREAM option.\n>>\n>> Signed-off-by: Alex Merry<dev@randomguy3.me.uk>\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 5a83090..89de45d 100755\n>> --- a/contrib/completion/git-completion.bash\n>> +++ b/contrib/completion/git-completion.bash\n>> @@ -106,8 +106,9 @@ __gitdir ()\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>>          while read key value; do\n"},{"id":"187347","messageId":"7vpqc75e3r.fsf@alter.siamese.dyndns.org","threadId":"28276","inReplyTo":"7vr4wn6y2k.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Fix git-completion.bash for use in zsh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-20T18:20:08Z","receivedAt":"2012-03-20T18:20:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"> Alex Merry <kde@randomguy3.me.uk> writes:\n> ...\n>> On 01/09/11 14:47, Alex Merry wrote:\n>>> Certain versions (or option combinations) of zsh appear to treat\n>>> things like\n>>> local some_var=()\n>>> as a function declaration.  This makes errors appear when using it in\n>>> combination with the GIT_PS1_SHOWUPSTREAM option.\n\nThe change in this patch itself may be innocuous, but we would point at\nthe log message of the commit this patch would create to the next person\nwho would write \"local var=()\" in contrib/completion/git-completion.bash\nfile and tell him to fix his patch.\n\nAnd for that purpose, the above log message is way too vague.  It is\nunclear how the problem can be reproduced (\"Certain versions\"??? \"option\ncombinations\"???  Even if you do not exhaustively enumerate the condition,\nyou at least should be able to say which *one* version you observed the\nproblem with, and with what option combinations).  It does not even say\nwhat symptom to expect (\"errors appear\"???  What error message would one\nget?).  We would need a more useful explanation to help people who make\nfurther changes to the code.\n\nAlso, the original patch was whitespace damaged IIRC.\n"}]}