{"thread":{"id":"31815","subject":"[PATCH] completion: add format-patch options to send-email","startedAt":"2012-10-14T16:14:03Z","lastAt":"2012-10-15T23:57:03Z","messageCount":6,"participants":["Felipe Contreras","SZEDER Gábor","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"201182","messageId":"1350231243-13485-1-git-send-email-felipe.contreras@gmail.com","threadId":"31815","inReplyTo":null,"subject":"[PATCH] completion: add format-patch options to send-email","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-14T16:14:03Z","receivedAt":"2012-10-14T16:14:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash | 35 +++++++++++++++++-----------------\n t/t9902-completion.sh                  | 21 ++++++++++++++++++++\n 2 files changed, 39 insertions(+), 17 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex d743e56..2a83504 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1112,6 +1112,14 @@ _git_fetch ()\n \t__git_complete_remote_or_refspec\n }\n \n+__git_format_patch_options=\"\n+\t--stdout --attach --no-attach --thread --thread= --output-directory\n+\t--numbered --start-number --numbered-files --keep-subject --signoff\n+\t--signature --no-signature --in-reply-to= --cc= --full-index --binary\n+\t--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=\n+\t--inline --suffix= --ignore-if-in-upstream --subject-prefix=\n+\"\n+\n _git_format_patch ()\n {\n \tcase \"$cur\" in\n@@ -1122,21 +1130,7 @@ _git_format_patch ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"\n-\t\t\t--stdout --attach --no-attach --thread --thread=\n-\t\t\t--output-directory\n-\t\t\t--numbered --start-number\n-\t\t\t--numbered-files\n-\t\t\t--keep-subject\n-\t\t\t--signoff --signature --no-signature\n-\t\t\t--in-reply-to= --cc=\n-\t\t\t--full-index --binary\n-\t\t\t--not --all\n-\t\t\t--cover-letter\n-\t\t\t--no-prefix --src-prefix= --dst-prefix=\n-\t\t\t--inline --suffix= --ignore-if-in-upstream\n-\t\t\t--subject-prefix=\n-\t\t\t\"\n+\t\t__gitcomp \"$__git_format_patch_options\"\n \t\treturn\n \t\t;;\n \tesac\n@@ -1550,6 +1544,12 @@ _git_send_email ()\n \t\t__gitcomp \"ssl tls\" \"\" \"${cur##--smtp-encryption=}\"\n \t\treturn\n \t\t;;\n+\t--thread=*)\n+\t\t__gitcomp \"\n+\t\t\tdeep shallow\n+\t\t\t\" \"\" \"${cur##--thread=}\"\n+\t\treturn\n+\t\t;;\n \t--*)\n \t\t__gitcomp \"--annotate --bcc --cc --cc-cmd --chain-reply-to\n \t\t\t--compose --confirm= --dry-run --envelope-sender\n@@ -1559,11 +1559,12 @@ _git_send_email ()\n \t\t\t--signed-off-by-cc --smtp-pass --smtp-server\n \t\t\t--smtp-server-port --smtp-encryption= --smtp-user\n \t\t\t--subject --suppress-cc= --suppress-from --thread --to\n-\t\t\t--validate --no-validate\"\n+\t\t\t--validate --no-validate\n+\t\t\t$__git_format_patch_options\"\n \t\treturn\n \t\t;;\n \tesac\n-\tCOMPREPLY=()\n+\t__git_complete_revlist_file\n }\n \n _git_stage ()\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 92d7eb4..c4b6c13 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -146,6 +146,22 @@ test_expect_success '__gitcomp - suffix' '\n \ttest_cmp expected out\n '\n \n+setup_repository ()\n+{\n+\tmkdir \"$1\" && (\n+\tcd \"$1\" &&\n+\tgit init &&\n+\ttest_tick &&\n+\tgit commit --allow-empty -m \"Initial\"\n+\t)\n+}\n+\n+test_expect_success 'prepare' '\n+\tsetup_repository one &&\n+\tgit clone one test &&\n+\tcd test\n+'\n+\n test_expect_success 'basic' '\n \trun_completion \"git \\\"\\\"\" &&\n \t# built-in\n@@ -228,4 +244,9 @@ test_expect_success 'general options plus command' '\n \ttest_completion \"git --no-replace-objects check\" \"checkout \"\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+'\n+\n test_done\n-- \n1.7.12.1\n"},{"id":"201293","messageId":"20121015224857.GA2156@goldbirke","threadId":"31815","inReplyTo":"1350231243-13485-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] completion: add format-patch options to send-email","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2012-10-15T22:48:57Z","receivedAt":"2012-10-15T22:48:57Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nOn Sun, Oct 14, 2012 at 06:14:03PM +0200, Felipe Contreras wrote:\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash | 35 +++++++++++++++++-----------------\n>  t/t9902-completion.sh                  | 21 ++++++++++++++++++++\n>  2 files changed, 39 insertions(+), 17 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index d743e56..2a83504 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n\nThis patch doesn't apply on current master.\n\n> @@ -1559,11 +1559,12 @@ _git_send_email ()\n>  \t\t\t--signed-off-by-cc --smtp-pass --smtp-server\n>  \t\t\t--smtp-server-port --smtp-encryption= --smtp-user\n>  \t\t\t--subject --suppress-cc= --suppress-from --thread --to\n> -\t\t\t--validate --no-validate\"\n> +\t\t\t--validate --no-validate\n> +\t\t\t$__git_format_patch_options\"\n>  \t\treturn\n>  \t\t;;\n>  \tesac\n> -\tCOMPREPLY=()\n> +\t__git_complete_revlist_file\n\nWhile send-email accepts a rev-list, it doesn't accept\n'HEAD:Documentation', does it?  So __git_complete_revlist() would be\nbetter here, because that makes the intent clear.\n\n>  }\n>  \n>  _git_stage ()\n> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> index 92d7eb4..c4b6c13 100755\n> --- a/t/t9902-completion.sh\n> +++ b/t/t9902-completion.sh\n> @@ -146,6 +146,22 @@ test_expect_success '__gitcomp - suffix' '\n>  \ttest_cmp expected out\n>  '\n>  \n> +setup_repository ()\n> +{\n> +\tmkdir \"$1\" && (\n> +\tcd \"$1\" &&\n> +\tgit init &&\n> +\ttest_tick &&\n> +\tgit commit --allow-empty -m \"Initial\"\n> +\t)\n> +}\n> +\n> +test_expect_success 'prepare' '\n> +\tsetup_repository one &&\n> +\tgit clone one test &&\n\nWhy are these new repositories needed?\n\n> +\tcd test\n\nThis 'cd' makes all subsequent tests to be executed in a different\nrepository than previously, which breaks 'checkout completes ref\nnames'.\n\n> +'\n> +\n>  test_expect_success 'basic' '\n>  \trun_completion \"git \\\"\\\"\" &&\n>  \t# built-in\n> @@ -228,4 +244,9 @@ test_expect_success 'general options plus command' '\n>  \ttest_completion \"git --no-replace-objects check\" \"checkout \"\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> +'\n> +\n>  test_done\n> -- \n> 1.7.12.1\n> \n"},{"id":"201295","messageId":"7vhapvuxgo.fsf@alter.siamese.dyndns.org","threadId":"31815","inReplyTo":"20121015224857.GA2156@goldbirke","subject":"Re: [PATCH] completion: add format-patch options to send-email","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-15T23:28:23Z","receivedAt":"2012-10-15T23:28:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SZEDER Gábor <szeder@ira.uka.de> writes:\n\n>> +\tcd test\n>\n> This 'cd' makes all subsequent tests to be executed in a different\n> repository than previously, which breaks 'checkout completes ref\n> names'.\n\nYeah, thanks for spotting and yelling at it ;-).\n\nWe really need to be careful about tests that cd around.  Even the\nones that only go down and expect the rest of the test to run in\nthat subdirectory may later have to be modified by somebody to run\nback at the original level, and writing \"cd ..\", which leads to all\nsorts of problems, becomes too tempting.\n\n>> +'\n>> +\n>>  test_expect_success 'basic' '\n>>  \trun_completion \"git \\\"\\\"\" &&\n>>  \t# built-in\n>> @@ -228,4 +244,9 @@ test_expect_success 'general options plus command' '\n>>  \ttest_completion \"git --no-replace-objects check\" \"checkout \"\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>> +'\n>> +\n>>  test_done\n>> -- \n>> 1.7.12.1\n>> \n"},{"id":"201296","messageId":"CAMP44s07iydg0aMDQMTX7qh4Kk8w--sp1DtmTUeu=95WzAXfRQ@mail.gmail.com","threadId":"31815","inReplyTo":"20121015224857.GA2156@goldbirke","subject":"Re: [PATCH] completion: add format-patch options to send-email","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-15T23:37:35Z","receivedAt":"2012-10-15T23:37:35Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Oct 16, 2012 at 12:48 AM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n\n>> @@ -1559,11 +1559,12 @@ _git_send_email ()\n>>                       --signed-off-by-cc --smtp-pass --smtp-server\n>>                       --smtp-server-port --smtp-encryption= --smtp-user\n>>                       --subject --suppress-cc= --suppress-from --thread --to\n>> -                     --validate --no-validate\"\n>> +                     --validate --no-validate\n>> +                     $__git_format_patch_options\"\n>>               return\n>>               ;;\n>>       esac\n>> -     COMPREPLY=()\n>> +     __git_complete_revlist_file\n>\n> While send-email accepts a rev-list, it doesn't accept\n> 'HEAD:Documentation', does it?  So __git_complete_revlist() would be\n> better here, because that makes the intent clear.\n\nThen _git_send_email should be fixed first. I'm simply doing the same\nas _git_send_email.\n\n>> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n>> index 92d7eb4..c4b6c13 100755\n>> --- a/t/t9902-completion.sh\n>> +++ b/t/t9902-completion.sh\n>> @@ -146,6 +146,22 @@ test_expect_success '__gitcomp - suffix' '\n>>       test_cmp expected out\n>>  '\n>>\n>> +setup_repository ()\n>> +{\n>> +     mkdir \"$1\" && (\n>> +     cd \"$1\" &&\n>> +     git init &&\n>> +     test_tick &&\n>> +     git commit --allow-empty -m \"Initial\"\n>> +     )\n>> +}\n>> +\n>> +test_expect_success 'prepare' '\n>> +     setup_repository one &&\n>> +     git clone one test &&\n>\n> Why are these new repositories needed?\n\nBecause otherwise 'git send-email ma' wouldn't succeed.\n\n>> +     cd test\n>\n> This 'cd' makes all subsequent tests to be executed in a different\n> repository than previously, which breaks 'checkout completes ref\n> names'.\n\nI don't know which test you are talking about, it's not on my repo,\nand all the completion test pass with this patch.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"201297","messageId":"20121015235537.GB2156@goldbirke","threadId":"31815","inReplyTo":"CAMP44s07iydg0aMDQMTX7qh4Kk8w--sp1DtmTUeu=95WzAXfRQ@mail.gmail.com","subject":"Re: [PATCH] completion: add format-patch options to send-email","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2012-10-15T23:55:37Z","receivedAt":"2012-10-15T23:55:37Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Oct 16, 2012 at 01:37:35AM +0200, Felipe Contreras wrote:\n> On Tue, Oct 16, 2012 at 12:48 AM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> \n> >> @@ -1559,11 +1559,12 @@ _git_send_email ()\n> >>                       --signed-off-by-cc --smtp-pass --smtp-server\n> >>                       --smtp-server-port --smtp-encryption= --smtp-user\n> >>                       --subject --suppress-cc= --suppress-from --thread --to\n> >> -                     --validate --no-validate\"\n> >> +                     --validate --no-validate\n> >> +                     $__git_format_patch_options\"\n> >>               return\n> >>               ;;\n> >>       esac\n> >> -     COMPREPLY=()\n> >> +     __git_complete_revlist_file\n> >\n> > While send-email accepts a rev-list, it doesn't accept\n> > 'HEAD:Documentation', does it?  So __git_complete_revlist() would be\n> > better here, because that makes the intent clear.\n> \n> Then _git_send_email should be fixed first. I'm simply doing the same\n> as _git_send_email.\n\nI can't decipher this recursion here.\n\n> >> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> >> index 92d7eb4..c4b6c13 100755\n> >> --- a/t/t9902-completion.sh\n> >> +++ b/t/t9902-completion.sh\n> >> @@ -146,6 +146,22 @@ test_expect_success '__gitcomp - suffix' '\n> >>       test_cmp expected out\n> >>  '\n> >>\n> >> +setup_repository ()\n> >> +{\n> >> +     mkdir \"$1\" && (\n> >> +     cd \"$1\" &&\n> >> +     git init &&\n> >> +     test_tick &&\n> >> +     git commit --allow-empty -m \"Initial\"\n> >> +     )\n> >> +}\n> >> +\n> >> +test_expect_success 'prepare' '\n> >> +     setup_repository one &&\n> >> +     git clone one test &&\n> >\n> > Why are these new repositories needed?\n> \n> Because otherwise 'git send-email ma' wouldn't succeed.\n\nEven then you don't need two additional repos, because just one\ncommit in the test repo would suffice.  And the test 'setup for ref\ncompletion' already takes care of that.\n\n> >> +     cd test\n> >\n> > This 'cd' makes all subsequent tests to be executed in a different\n> > repository than previously, which breaks 'checkout completes ref\n> > names'.\n> \n> I don't know which test you are talking about, it's not on my repo,\n> and all the completion test pass with this patch.\n\nIt's in v1.8.0-rc0~1^2 (t9902: add completion tests for \"odd\" filenames,\n2012-09-26), which is the commit your patch conflicts with.\n\n\nBest,\nGábor\n"},{"id":"201298","messageId":"CAMP44s3T-kBgN7ihzLQJKZqFtAM6_ne2QF3+THU9z0YsqGp+hA@mail.gmail.com","threadId":"31815","inReplyTo":"CAMP44s07iydg0aMDQMTX7qh4Kk8w--sp1DtmTUeu=95WzAXfRQ@mail.gmail.com","subject":"Re: [PATCH] completion: add format-patch options to send-email","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-15T23:57:03Z","receivedAt":"2012-10-15T23:57:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Oct 16, 2012 at 1:37 AM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> On Tue, Oct 16, 2012 at 12:48 AM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n\n>>> +     cd test\n>>\n>> This 'cd' makes all subsequent tests to be executed in a different\n>> repository than previously, which breaks 'checkout completes ref\n>> names'.\n>\n> I don't know which test you are talking about, it's not on my repo,\n> and all the completion test pass with this patch.\n\nMaybe this then:\n\ntest_expect_success 'prepare' '\n\tgit init &&\n\ttest_tick &&\n\tgit commit --allow-empty -m \"Initial\"\n'\n\nI originally created those for some push and fetch tests, but that\nrequired too many reorganizations, and I got fed up with the review,\nso I dropped the series[1].\n\nCheers.\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/197226\n\n-- \nFelipe Contreras\n"}]}