{"thread":{"id":"45730","subject":"[PATCH] completion: expand \"push --delete <remote> <ref>\" for refs on that <remote>","startedAt":"2017-04-18T13:32:13Z","lastAt":"2017-04-22T17:55:26Z","messageCount":4,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"317105","messageId":"20170418133152.3262-1-avarab@gmail.com","threadId":"45730","inReplyTo":null,"subject":"[PATCH] completion: expand \"push --delete <remote> <ref>\" for refs on that <remote>","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-04-18T13:31:52Z","receivedAt":"2017-04-18T13:32:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the completion of \"push --delete <remote> <ref>\" to complete\nrefs on that <remote>, not all refs. Before this e.g. cloning git.git\nand doing \"git push --delete origin p<TAB>\" will complete nothing,\nwhereas origin/p<TAB> will uselessly complete origin/pu.\n\nNow p<TAB> will complete as \"pu\". The completion of giving --delete\nlater, e.g. \"git push origin --delete p<TAB>\" remains unchanged, this\nis a bug, but is a general existing limitation of the bash completion,\nand not how git-push is documented, so I'm not fixing that case.\n\nI looked over t9902-completion.sh but couldn't quickly find out how to\nadd a test for this, but all the existing tests pass, and all my\nmanual testing of \"git push --delete <remote> ...\" does the right\nthing now.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n contrib/completion/git-completion.bash | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1150164d5c..2e5b3ed776 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -701,7 +701,7 @@ __git_complete_revlist ()\n __git_complete_remote_or_refspec ()\n {\n \tlocal cur_=\"$cur\" cmd=\"${words[1]}\"\n-\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n+\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0 delete=0\n \tif [ \"$cmd\" = \"remote\" ]; then\n \t\t((c++))\n \tfi\n@@ -709,6 +709,7 @@ __git_complete_remote_or_refspec ()\n \t\ti=\"${words[c]}\"\n \t\tcase \"$i\" in\n \t\t--mirror) [ \"$cmd\" = \"push\" ] && no_complete_refspec=1 ;;\n+\t\t--delete) delete=1 ;;\n \t\t--all)\n \t\t\tcase \"$cmd\" in\n \t\t\tpush) no_complete_refspec=1 ;;\n@@ -761,7 +762,9 @@ __git_complete_remote_or_refspec ()\n \t\tfi\n \t\t;;\n \tpush)\n-\t\tif [ $lhs = 1 ]; then\n+\t\tif [ $delete = 1 ]; then\n+\t\t\t__git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n+\t\telif [ $lhs = 1 ]; then\n \t\t\t__git_complete_refs --pfx=\"$pfx\" --cur=\"$cur_\"\n \t\telse\n \t\t\t__git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n-- \n2.11.0\n\n"},{"id":"317184","messageId":"xmqqo9vtawmi.fsf@gitster.mtv.corp.google.com","threadId":"45730","inReplyTo":"20170418133152.3262-1-avarab@gmail.com","subject":"Re: [PATCH] completion: expand \"push --delete <remote> <ref>\" for refs on that <remote>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-04-19T03:45:25Z","receivedAt":"2017-04-19T03:45:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Change the completion of \"push --delete <remote> <ref>\" to complete\n> refs on that <remote>, not all refs. Before this e.g. cloning git.git\n> and doing \"git push --delete origin p<TAB>\" will complete nothing,\n> whereas origin/p<TAB> will uselessly complete origin/pu.\n>\n> Now p<TAB> will complete as \"pu\". The completion of giving --delete\n> later, e.g. \"git push origin --delete p<TAB>\" remains unchanged, this\n> is a bug, but is a general existing limitation of the bash completion,\n> and not how git-push is documented, so I'm not fixing that case.\n>\n> I looked over t9902-completion.sh but couldn't quickly find out how to\n> add a test for this, but all the existing tests pass, and all my\n> manual testing of \"git push --delete <remote> ...\" does the right\n> thing now.\n>\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n\nThis looks like a sensible thing to want to add.  Perhaps somebody\nmore familiar with the completion tests can help with t/ and also\ngive us general comments.  Until then, let me queue it as is on\n'pu'.\n\nThanks.\n\n>  contrib/completion/git-completion.bash | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 1150164d5c..2e5b3ed776 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -701,7 +701,7 @@ __git_complete_revlist ()\n>  __git_complete_remote_or_refspec ()\n>  {\n>  \tlocal cur_=\"$cur\" cmd=\"${words[1]}\"\n> -\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n> +\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0 delete=0\n>  \tif [ \"$cmd\" = \"remote\" ]; then\n>  \t\t((c++))\n>  \tfi\n> @@ -709,6 +709,7 @@ __git_complete_remote_or_refspec ()\n>  \t\ti=\"${words[c]}\"\n>  \t\tcase \"$i\" in\n>  \t\t--mirror) [ \"$cmd\" = \"push\" ] && no_complete_refspec=1 ;;\n> +\t\t--delete) delete=1 ;;\n>  \t\t--all)\n>  \t\t\tcase \"$cmd\" in\n>  \t\t\tpush) no_complete_refspec=1 ;;\n> @@ -761,7 +762,9 @@ __git_complete_remote_or_refspec ()\n>  \t\tfi\n>  \t\t;;\n>  \tpush)\n> -\t\tif [ $lhs = 1 ]; then\n> +\t\tif [ $delete = 1 ]; then\n> +\t\t\t__git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n> +\t\telif [ $lhs = 1 ]; then\n>  \t\t\t__git_complete_refs --pfx=\"$pfx\" --cur=\"$cur_\"\n>  \t\telse\n>  \t\t\t__git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n"},{"id":"317488","messageId":"20170421122832.24617-1-szeder.dev@gmail.com","threadId":"45730","inReplyTo":"20170418133152.3262-1-avarab@gmail.com","subject":"Re: [PATCH] completion: expand \"push --delete <remote> <ref>\" for refs on that <remote>","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2017-04-21T12:28:32Z","receivedAt":"2017-04-21T12:29:00Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"\nOn Tue, Apr 18, 2017 at 3:31 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> Change the completion of \"push --delete <remote> <ref>\" to complete\n> refs on that <remote>, not all refs.\n\nGood.\n\n> Before this e.g. cloning git.git\n> and doing \"git push --delete origin p<TAB>\" will complete nothing,\n\nWell, it will complete all local branches starting with 'p', but\nperhaps you don't happen to have any.\n\n> whereas origin/p<TAB> will uselessly complete origin/pu.\n> \n> Now p<TAB> will complete as \"pu\". The completion of giving --delete\n> later, e.g. \"git push origin --delete p<TAB>\" remains unchanged, this\n> is a bug, but is a general existing limitation of the bash completion,\n> and not how git-push is documented, so I'm not fixing that case.\n> \n> I looked over t9902-completion.sh but couldn't quickly find out how to\n> add a test for this,\n\nYeah, this helper function has to look at the whole command line to do\nits thing, and we don't have other unit test-like tests doing\nsomething like that.\n\nOne option would be something like this:\n\n@@ -1162,6 +1162,19 @@ test_expect_success '__git_complete_fetch_refspecs - fully qualified & prefix' '\n \ttest_cmp expected out\n '\n \n+test_expect_success '__git_complete_remote_or_refspec - push -d' '\n+\tsed -e \"s/Z$//\" >expected <<-EOF &&\n+\tmaster-in-other Z\n+\tEOF\n+\t(\n+\t\twords=(git push -d other ma) &&\n+\t\tcword=${#words[@]} cur=${words[cword-1]} &&\n+\t\t__git_complete_remote_or_refspec &&\n+\t\tprint_comp\n+\t) &&\n+\ttest_cmp expected out\n+'\n+\n test_expect_success 'teardown after ref completion' '\n \tgit branch -d matching-branch &&\n \tgit tag -d matching-tag &&\n\nThis is chatty, no question about that, but it only excercises\n__git_complete_remote_or_refspec() (and __git_refs() behind its back),\nand thus fits right in there with other refs completion tests.\n\n\nThe other option would be something like this:\n\n@@ -1348,6 +1361,10 @@ test_expect_success 'complete tree filename with metacharacters' '\n \tEOF\n '\n \n+test_expect_success 'complete remote refs for git push -d' '\n+\ttest_completion \"git push -d other ma\" \"master-in-other \"\n+'\n+\n test_expect_success 'send-email' '\n \ttest_completion \"git send-email --cov\" \"--cover-letter \" &&\n \ttest_completion \"git send-email ma\" \"master \"\n\nWhile this is much more compact, it does excercise the whole shebang,\ntherefore it has to go to the integration tests.  However, at that\npoint in the test script there aren't any remote refs in the\nrepository (and, consequently this test will fail as it is), so you\nwould need to add a few, which in turn would most likely require\nadjustments in other tests.\n\nI'm partial to the former, even if it's more lines of code, because if\nit were to fail, then it already narrowed down the scope where we'd\nneed to look for the cause of the failure.\n\nTake your pick :)\n\n> but all the existing tests pass, and all my\n> manual testing of \"git push --delete <remote> ...\" does the right\n> thing now.\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 1150164d5c..2e5b3ed776 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -701,7 +701,7 @@ __git_complete_revlist ()\n>  __git_complete_remote_or_refspec ()\n>  {\n>  \tlocal cur_=\"$cur\" cmd=\"${words[1]}\"\n> -\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n> +\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0 delete=0\n>  \tif [ \"$cmd\" = \"remote\" ]; then\n>  \t\t((c++))\n>  \tfi\n> @@ -709,6 +709,7 @@ __git_complete_remote_or_refspec ()\n>  \t\ti=\"${words[c]}\"\n>  \t\tcase \"$i\" in\n>  \t\t--mirror) [ \"$cmd\" = \"push\" ] && no_complete_refspec=1 ;;\n> +\t\t--delete) delete=1 ;;\n\nI noticed the two identical __git_complete_refs() calls in the hunk\nbelow.  How about:\n\n  -d|--delete) [ \"$cmd\" = \"push\" ] && lhs=0 ;;\n\nFirst, it recognizes the short option, too.\nSecond, with 'push -d' any ref is interpreted as the right hand side\nof a refspec whose left hand side is empty (i.e. '-d pu' means ':pu').\nThat 'lhs=0' tells the rest of the function to complete the right hand\nside of a refspec, i.e. in case of 'push' to list remote refs, which\nis exactly what you want.  And you won't need the extra if branch in\nthe hunk below, or the new local variable.\nIn this case, however, we should check that the command is 'push' as\nwell, just in case the other commands whose completion is driven by\nthis helper function get these options in the future.\n\n>  \t\t--all)\n>  \t\t\tcase \"$cmd\" in\n>  \t\t\tpush) no_complete_refspec=1 ;;\n> @@ -761,7 +762,9 @@ __git_complete_remote_or_refspec ()\n>  \t\tfi\n>  \t\t;;\n>  \tpush)\n> -\t\tif [ $lhs = 1 ]; then\n> +\t\tif [ $delete = 1 ]; then\n> +\t\t\t__git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n> +\t\telif [ $lhs = 1 ]; then\n>  \t\t\t__git_complete_refs --pfx=\"$pfx\" --cur=\"$cur_\"\n>  \t\telse\n>  \t\t\t__git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n> -- \n> 2.11.0\n"},{"id":"317547","messageId":"20170422175504.19999-1-avarab@gmail.com","threadId":"45730","inReplyTo":"20170421122832.24617-1-szeder.dev@gmail.com","subject":"[PATCH v2] completion: expand \"push --delete <remote> <ref>\" for refs on that <remote>","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-04-22T17:55:04Z","receivedAt":"2017-04-22T17:55:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the completion of \"push --delete <remote> <ref>\" to complete\nrefs on that <remote>, not all refs.\n\nBefore this cloning git.git and doing \"git push --delete origin\np<TAB>\" will complete nothing, since a fresh clone of git.git will\nhave no \"pu\" branch, whereas origin/p<TAB> will uselessly complete\norigin/pu, but fully qualified references aren't accepted by\n\"--delete\".\n\nNow p<TAB> will complete as \"pu\". The completion of giving --delete\nlater, e.g. \"git push origin --delete p<TAB>\" remains unchanged, this\nis a bug, but is a general existing limitation of the bash completion,\nand not how git-push is documented, so I'm not fixing that case, but\nadding a failing TODO test for it.\n\nThe testing code was supplied by SZEDER Gábor in\n<20170421122832.24617-1-szeder.dev@gmail.com> with minor setup\nmodifications on my part.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: SZEDER Gábor <szeder.dev@gmail.com>\nTest-code-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n\nOn Fri, Apr 21, 2017 at 2:28 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:\n>\n> On Tue, Apr 18, 2017 at 3:31 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n>> Change the completion of \"push --delete <remote> <ref>\" to complete\n>> refs on that <remote>, not all refs.\n>\n> Good.\n>\n>> Before this e.g. cloning git.git\n>> and doing \"git push --delete origin p<TAB>\" will complete nothing,\n>\n> Well, it will complete all local branches starting with 'p', but\n> perhaps you don't happen to have any.\n>\n>> whereas origin/p<TAB> will uselessly complete origin/pu.\n>>\n>> Now p<TAB> will complete as \"pu\". The completion of giving --delete\n>> later, e.g. \"git push origin --delete p<TAB>\" remains unchanged, this\n>> is a bug, but is a general existing limitation of the bash completion,\n>> and not how git-push is documented, so I'm not fixing that case.\n>>\n>> I looked over t9902-completion.sh but couldn't quickly find out how to\n>> add a test for this,\n>\n> Yeah, this helper function has to look at the whole command line to do\n> its thing, and we don't have other unit test-like tests doing\n> something like that.\n>\n> One option would be something like this:\n>\n> @@ -1162,6 +1162,19 @@ test_expect_success '__git_complete_fetch_refspecs - fully qualified & prefix' '\n>         test_cmp expected out\n>  '\n>\n> +test_expect_success '__git_complete_remote_or_refspec - push -d' '\n> +       sed -e \"s/Z$//\" >expected <<-EOF &&\n> +       master-in-other Z\n> +       EOF\n> +       (\n> +               words=(git push -d other ma) &&\n> +               cword=${#words[@]} cur=${words[cword-1]} &&\n> +               __git_complete_remote_or_refspec &&\n> +               print_comp\n> +       ) &&\n> +       test_cmp expected out\n> +'\n> +\n>  test_expect_success 'teardown after ref completion' '\n>         git branch -d matching-branch &&\n>         git tag -d matching-tag &&\n>\n> This is chatty, no question about that, but it only excercises\n> __git_complete_remote_or_refspec() (and __git_refs() behind its back),\n> and thus fits right in there with other refs completion tests.\n>\n>\n> The other option would be something like this:\n>\n> @@ -1348,6 +1361,10 @@ test_expect_success 'complete tree filename with metacharacters' '\n>         EOF\n>  '\n>\n> +test_expect_success 'complete remote refs for git push -d' '\n> +       test_completion \"git push -d other ma\" \"master-in-other \"\n> +'\n> +\n>  test_expect_success 'send-email' '\n>         test_completion \"git send-email --cov\" \"--cover-letter \" &&\n>         test_completion \"git send-email ma\" \"master \"\n>\n> While this is much more compact, it does excercise the whole shebang,\n> therefore it has to go to the integration tests.  However, at that\n> point in the test script there aren't any remote refs in the\n> repository (and, consequently this test will fail as it is), so you\n> would need to add a few, which in turn would most likely require\n> adjustments in other tests.\n>\n> I'm partial to the former, even if it's more lines of code, because if\n> it were to fail, then it already narrowed down the scope where we'd\n> need to look for the cause of the failure.\n>\n> Take your pick :)\n>\n>> but all the existing tests pass, and all my\n>> manual testing of \"git push --delete <remote> ...\" does the right\n>> thing now.\n>>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>>  contrib/completion/git-completion.bash | 7 +++++--\n>>  1 file changed, 5 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n>> index 1150164d5c..2e5b3ed776 100644\n>> --- a/contrib/completion/git-completion.bash\n>> +++ b/contrib/completion/git-completion.bash\n>> @@ -701,7 +701,7 @@ __git_complete_revlist ()\n>>  __git_complete_remote_or_refspec ()\n>>  {\n>>       local cur_=\"$cur\" cmd=\"${words[1]}\"\n>> -     local i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n>> +     local i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0 delete=0\n>>       if [ \"$cmd\" = \"remote\" ]; then\n>>               ((c++))\n>>       fi\n>> @@ -709,6 +709,7 @@ __git_complete_remote_or_refspec ()\n>>               i=\"${words[c]}\"\n>>               case \"$i\" in\n>>               --mirror) [ \"$cmd\" = \"push\" ] && no_complete_refspec=1 ;;\n>> +             --delete) delete=1 ;;\n>\n> I noticed the two identical __git_complete_refs() calls in the hunk\n> below.  How about:\n>\n>   -d|--delete) [ \"$cmd\" = \"push\" ] && lhs=0 ;;\n>\n> First, it recognizes the short option, too.\n> Second, with 'push -d' any ref is interpreted as the right hand side\n> of a refspec whose left hand side is empty (i.e. '-d pu' means ':pu').\n> That 'lhs=0' tells the rest of the function to complete the right hand\n> side of a refspec, i.e. in case of 'push' to list remote refs, which\n> is exactly what you want.  And you won't need the extra if branch in\n> the hunk below, or the new local variable.\n> In this case, however, we should check that the command is 'push' as\n> well, just in case the other commands whose completion is driven by\n> this helper function get these options in the future.\n\nThanks a lot. I changed all of this as you suggested & integrated your\ntesting code, now also with a TODO test for \"git push origin\n--delete\".\n\n>>               --all)\n>>                       case \"$cmd\" in\n>>                       push) no_complete_refspec=1 ;;\n>> @@ -761,7 +762,9 @@ __git_complete_remote_or_refspec ()\n>>               fi\n>>               ;;\n>>       push)\n>> -             if [ $lhs = 1 ]; then\n>> +             if [ $delete = 1 ]; then\n>> +                     __git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n>> +             elif [ $lhs = 1 ]; then\n>>                       __git_complete_refs --pfx=\"$pfx\" --cur=\"$cur_\"\n>>               else\n>>                       __git_complete_refs --remote=\"$remote\" --pfx=\"$pfx\" --cur=\"$cur_\"\n>> --\n>> 2.11.0\n\n contrib/completion/git-completion.bash |  1 +\n t/t9902-completion.sh                  | 34 ++++++++++++++++++++++++++++++++++\n 2 files changed, 35 insertions(+)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1150164d5c..b617019075 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -709,6 +709,7 @@ __git_complete_remote_or_refspec ()\n \t\ti=\"${words[c]}\"\n \t\tcase \"$i\" in\n \t\t--mirror) [ \"$cmd\" = \"push\" ] && no_complete_refspec=1 ;;\n+\t\t-d|--delete) [ \"$cmd\" = \"push\" ] && lhs=0 ;;\n \t\t--all)\n \t\t\tcase \"$cmd\" in\n \t\t\tpush) no_complete_refspec=1 ;;\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 5ed28135be..2cb999ecfa 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -1457,4 +1457,38 @@ test_expect_failure 'complete with tilde expansion' '\n \ttest_completion \"git add ~/tmp/\" \"~/tmp/file\"\n '\n \n+test_expect_success 'setup other remote for remote reference completion' '\n+\tgit remote add other otherrepo &&\n+\tgit fetch other\n+'\n+\n+for flag in -d --delete\n+do\n+\ttest_expect_success \"__git_complete_remote_or_refspec - push $flag other\" '\n+\t\tsed -e \"s/Z$//\" >expected <<-EOF &&\n+\t\tmaster-in-other Z\n+\t\tEOF\n+\t\t(\n+\t\t\twords=(git push '$flag' other ma) &&\n+\t\t\tcword=${#words[@]} cur=${words[cword-1]} &&\n+\t\t\t__git_complete_remote_or_refspec &&\n+\t\t\tprint_comp\n+\t\t) &&\n+\t\ttest_cmp expected out\n+\t'\n+\n+\ttest_expect_failure \"__git_complete_remote_or_refspec - push other $flag\" '\n+\t\tsed -e \"s/Z$//\" >expected <<-EOF &&\n+\t\tmaster-in-other Z\n+\t\tEOF\n+\t\t(\n+\t\t\twords=(git push other '$flag' ma) &&\n+\t\t\tcword=${#words[@]} cur=${words[cword-1]} &&\n+\t\t\t__git_complete_remote_or_refspec &&\n+\t\t\tprint_comp\n+\t\t) &&\n+\t\ttest_cmp expected out\n+\t'\n+done\n+\n test_done\n-- \n2.11.0\n\n"}]}