{"thread":{"id":"32662","subject":"[PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X","startedAt":"2013-01-18T10:31:05Z","lastAt":"2013-01-18T19:24:01Z","messageCount":6,"participants":["Brandon Casey","Andreas Schwab","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"207198","messageId":"1358505065-16913-1-git-send-email-drafnel@gmail.com","threadId":"32662","inReplyTo":null,"subject":"[PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2013-01-18T10:31:05Z","receivedAt":"2013-01-18T10:31:05Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"When commit d8b45314 began separating the zsh completion from the bash\ncompletion, it introduced a zsh completion \"bridge\" section into the bash\ncompletion script for zsh users to use until they migrated to the zsh\nscript.  The zsh '+=()' append-to-array notation prevents bash 3.00.15 on\nCentOS 4.x from loading the completion script and breaks test 9902.  We can\neasily work around this by using standard Bash array notation.\n\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n contrib/completion/git-completion.bash | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex a4c48e1..c14e329 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2431,7 +2431,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then\n \t\t\t\t--*=*|*.) ;;\n \t\t\t\t*) c=\"$c \" ;;\n \t\t\t\tesac\n-\t\t\t\tarray+=(\"$c\")\n+\t\t\t\tarray[$(($#array+1))]=\"$c\"\n \t\t\tdone\n \t\t\tcompset -P '*[=:]'\n \t\t\tcompadd -Q -S '' -p \"${2-}\" -a -- array && _ret=0\n-- \n1.8.1.1.252.gdb33759\n"},{"id":"207201","messageId":"m2obgmjzz0.fsf@igel.home","threadId":"32662","inReplyTo":"1358505065-16913-1-git-send-email-drafnel@gmail.com","subject":"Re: [PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2013-01-18T15:02:59Z","receivedAt":"2013-01-18T15:02:59Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Brandon Casey <drafnel@gmail.com> writes:\n\n> +\t\t\t\tarray[$(($#array+1))]=\"$c\"\n\nYou don't need $(( )) since the array index is already evaluated as an\narithmethic expression.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"207215","messageId":"CA+sFfMd6FLchoOcUpNZ3AxTLNp3qe=VjijRid4sWf-A3_w88qw@mail.gmail.com","threadId":"32662","inReplyTo":"m2obgmjzz0.fsf@igel.home","subject":"Re: [PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2013-01-18T19:07:14Z","receivedAt":"2013-01-18T19:07:14Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"On Fri, Jan 18, 2013 at 7:02 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Brandon Casey <drafnel@gmail.com> writes:\n>\n>> +                             array[$(($#array+1))]=\"$c\"\n>\n> You don't need $(( )) since the array index is already evaluated as an\n> arithmethic expression.\n\nAh, I didn't know that.  Thanks.\n\nI think Junio will probably fix this up if he thinks it's worth it,\nbut I can resubmit if necessary.\n\n-Brandon\n"},{"id":"207216","messageId":"7vr4liqpg4.fsf@alter.siamese.dyndns.org","threadId":"32662","inReplyTo":"CA+sFfMd6FLchoOcUpNZ3AxTLNp3qe=VjijRid4sWf-A3_w88qw@mail.gmail.com","subject":"Re: [PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-18T19:08:27Z","receivedAt":"2013-01-18T19:08:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <drafnel@gmail.com> writes:\n\n> On Fri, Jan 18, 2013 at 7:02 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n>> Brandon Casey <drafnel@gmail.com> writes:\n>>\n>>> +                             array[$(($#array+1))]=\"$c\"\n>>\n>> You don't need $(( )) since the array index is already evaluated as an\n>> arithmethic expression.\n>\n> Ah, I didn't know that.  Thanks.\n>\n> I think Junio will probably fix this up if he thinks it's worth it,\n> but I can resubmit if necessary.\n\nPlease; I do not have mental bandwidth to keep track of contrib/\nmaterial myself.\n"},{"id":"207217","messageId":"CA+sFfMd7hurR=4n1r9RLtMYoxnM_LFH5j1McJc8+8_JumqviLg@mail.gmail.com","threadId":"32662","inReplyTo":"7vr4liqpg4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-completion.bash: replace zsh notation that breaks bash 3.X","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2013-01-18T19:11:31Z","receivedAt":"2013-01-18T19:11:31Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"On Fri, Jan 18, 2013 at 11:08 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Brandon Casey <drafnel@gmail.com> writes:\n>\n>> On Fri, Jan 18, 2013 at 7:02 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n>>> Brandon Casey <drafnel@gmail.com> writes:\n>>>\n>>>> +                             array[$(($#array+1))]=\"$c\"\n>>>\n>>> You don't need $(( )) since the array index is already evaluated as an\n>>> arithmethic expression.\n>>\n>> Ah, I didn't know that.  Thanks.\n>>\n>> I think Junio will probably fix this up if he thinks it's worth it,\n>> but I can resubmit if necessary.\n>\n> Please; I do not have mental bandwidth to keep track of contrib/\n> material myself.\n\nNo problem.\n\n-Brandon\n"},{"id":"207218","messageId":"1358537041-29333-1-git-send-email-drafnel@gmail.com","threadId":"32662","inReplyTo":"CA+sFfMd7hurR=4n1r9RLtMYoxnM_LFH5j1McJc8+8_JumqviLg@mail.gmail.com","subject":"[PATCH v2] git-completion.bash: replace zsh notation that breaks bash 3.X","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2013-01-18T19:24:01Z","receivedAt":"2013-01-18T19:24:01Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"When commit d8b45314 began separating the zsh completion from the bash\ncompletion, it introduced a zsh completion \"bridge\" section into the bash\ncompletion script for zsh users to use until they migrated to the zsh\nscript.  The zsh '+=()' append-to-array notation prevents bash 3.00.15 on\nCentOS 4.x from loading the completion script and breaks test 9902.  We can\neasily work around this by using standard Bash array notation.\n\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n\n\nOn Fri, Jan 18, 2013 at 7:02 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Brandon Casey <drafnel@gmail.com> writes:\n>\n>> +                             array[$(($#array+1))]=\"$c\"\n>\n> You don't need $(( )) since the array index is already evaluated as an\n> arithmethic expression.\n\nFixed.\n\n-Brandon\n\n\n contrib/completion/git-completion.bash |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex a4c48e1..2f99420 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2431,7 +2431,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then\n \t\t\t\t--*=*|*.) ;;\n \t\t\t\t*) c=\"$c \" ;;\n \t\t\t\tesac\n-\t\t\t\tarray+=(\"$c\")\n+\t\t\t\tarray[$#array+1]=\"$c\"\n \t\t\tdone\n \t\t\tcompset -P '*[=:]'\n \t\t\tcompadd -Q -S '' -p \"${2-}\" -a -- array && _ret=0\n-- \n1.7.8.4\n\n\n-----------------------------------------------------------------------------------\nThis email message is for the sole use of the intended recipient(s) and may contain\nconfidential information.  Any unauthorized review, use, disclosure or distribution\nis prohibited.  If you are not the intended recipient, please contact the sender by\nreply email and destroy all copies of the original message.\n-----------------------------------------------------------------------------------\n"}]}