{"thread":{"id":"60699","subject":"[PATCH 0/1] completion: send-email: don't complete revs when --no-format-patch","startedAt":"2024-01-08T09:36:06Z","lastAt":"2024-04-28T22:55:31Z","messageCount":11,"participants":["Britton Leo Kerin","Dragan Simic","Britton Kerin","Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"486382","messageId":"9627364b-c0c9-4b85-a81a-ba1ef0735c9a@smtp-relay.sendinblue.com","threadId":"60699","inReplyTo":null,"subject":"[PATCH 0/1] completion: send-email: don't complete revs when --no-format-patch","fromName":"Britton Leo Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2024-01-08T09:36:00Z","receivedAt":"2024-01-08T09:36:06Z","isPatch":true,"sender":{"key":"britton.kerin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7434164?v=4"},"body":"Along the way I taught __git_find_last_on_cmdline to understand '--', which\nisn't stricly necessary but I think reads more clearly at the call sites.\n__git_find_on_cmdline could be changed to work the same, or this part dropped\nif people don't like it.\n\nBritton Leo Kerin (1):\n  completion: don't comp revs when --no-format-patch\n\n contrib/completion/git-completion.bash | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\n\nbase-commit: e79552d19784ee7f4bbce278fe25f93fbda196fa\n--\n2.43.0\n\n\n"},{"id":"486384","messageId":"0e8a1572100faae72db54becefe19f6b@manjaro.org","threadId":"60699","inReplyTo":"9627364b-c0c9-4b85-a81a-ba1ef0735c9a@smtp-relay.sendinblue.com","subject":"Re: [PATCH 0/1] completion: send-email: don't complete revs when --no-format-patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-01-08T09:40:56Z","receivedAt":"2024-01-08T09:41:04Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-01-08 10:36, Britton Leo Kerin wrote:\n> Along the way I taught __git_find_last_on_cmdline to understand '--', \n> which\n> isn't stricly necessary but I think reads more clearly at the call \n> sites.\n> __git_find_on_cmdline could be changed to work the same, or this part \n> dropped\n> if people don't like it.\n\nIf I may suggest, there's no need for a cover letter for a single patch. \n  If you want to include some notes in the patch submission, which aren't \nsupposed to be part of the commit summary, you can do that in the patch \nitself.\n\n> Britton Leo Kerin (1):\n>   completion: don't comp revs when --no-format-patch\n> \n>  contrib/completion/git-completion.bash | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n> \n> \n> base-commit: e79552d19784ee7f4bbce278fe25f93fbda196fa\n> --\n> 2.43.0\n"},{"id":"486409","messageId":"CAC4O8c8Evt1XEggVWoVCFCQ-mUkS-=dBYEKM8uuq9WEi-sMdwg@mail.gmail.com","threadId":"60699","inReplyTo":"0e8a1572100faae72db54becefe19f6b@manjaro.org","subject":"Re: [PATCH 0/1] completion: send-email: don't complete revs when --no-format-patch","fromName":"Britton Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2024-01-08T19:34:17Z","receivedAt":"2024-01-08T19:34:30Z","isPatch":true,"sender":{"key":"britton.kerin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7434164?v=4"},"body":"On Mon, Jan 8, 2024 at 12:40 AM Dragan Simic <dsimic@manjaro.org> wrote:\n>\n> On 2024-01-08 10:36, Britton Leo Kerin wrote:\n> > Along the way I taught __git_find_last_on_cmdline to understand '--',\n> > which\n> > isn't stricly necessary but I think reads more clearly at the call\n> > sites.\n> > __git_find_on_cmdline could be changed to work the same, or this part\n> > dropped\n> > if people don't like it.\n>\n> If I may suggest, there's no need for a cover letter for a single patch.\n>   If you want to include some notes in the patch submission, which aren't\n> supposed to be part of the commit summary, you can do that in the patch\n> itself.\n\nOk thanks, I'll do it that way in future.\n\nBritton\n"},{"id":"486416","messageId":"c9656f53-daa1-4e4e-852c-31997cef6ba5@smtp-relay.sendinblue.com","threadId":"60699","inReplyTo":"9627364b-c0c9-4b85-a81a-ba1ef0735c9a@smtp-relay.sendinblue.com","subject":"[PATCH v2 0/1] completion: don't complete revs when --no-format-patch","fromName":"Britton Leo Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2024-01-09T01:08:29Z","receivedAt":"2024-01-09T01:08:35Z","isPatch":true,"sender":{"key":"britton.kerin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7434164?v=4"},"body":"Improve commit message\n\nBritton Leo Kerin (1):\n  completion: don't complete revs when --no-format-patch\n\n contrib/completion/git-completion.bash | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\nRange-diff against v1:\n1:  ff4d2e55e3 ! 1:  e56dbbacd9 completion: don't comp revs when --no-format-patch\n    @@ Metadata\n     Author: Britton Leo Kerin <britton.kerin@gmail.com>\n\n      ## Commit message ##\n    -    completion: don't comp revs when --no-format-patch\n    +    completion: don't complete revs when --no-format-patch\n\n         In this case the user has specifically said they don't want send-email\n         to run format-patch so revs aren't valid argument completions (and it's\n--\n2.43.0\n\n\n"},{"id":"486417","messageId":"a718b5ee-afb0-44bd-a299-3208fac43506@smtp-relay.sendinblue.com","threadId":"60699","inReplyTo":"20240109010830.458775-1-britton.kerin@gmail.com","subject":"[PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Britton Leo Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2024-01-09T01:08:30Z","receivedAt":"2024-01-09T01:08:35Z","isPatch":true,"sender":{"key":"britton.kerin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7434164?v=4"},"body":"In this case the user has specifically said they don't want send-email\nto run format-patch so revs aren't valid argument completions (and it's\nlikely revs and dirs do have some same names or prefixes as in\nDocumentation/MyFirstContribution.txt 'psuh').\n\nSigned-off-by: Britton Leo Kerin <britton.kerin@gmail.com>\n---\n contrib/completion/git-completion.bash | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 185b47d802..c983f3b2ab 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1242,10 +1242,12 @@ __git_find_last_on_cmdline ()\n \twhile test $# -gt 1; do\n \t\tcase \"$1\" in\n \t\t--show-idx)\tshow_idx=y ;;\n+\t\t--)\t\tshift && break ;;\n \t\t*)\t\treturn 1 ;;\n \t\tesac\n \t\tshift\n \tdone\n+\t[ $# -eq 1 ] || return 1   # return 1 if we got wrong # of non-opts\n \tlocal wordlist=\"$1\"\n \n \twhile [ $c -gt \"$__git_cmd_idx\" ]; do\n@@ -2429,7 +2431,9 @@ _git_send_email ()\n \t\treturn\n \t\t;;\n \tesac\n-\t__git_complete_revlist\n+\tif [ \"$(__git_find_last_on_cmdline -- \"--format-patch --no-format-patch\")\" != \"--no-format-patch\" ]; then\n+\t\t__git_complete_revlist\n+\tfi\n }\n \n _git_stage ()\n-- \n2.43.0\n\n\n"},{"id":"488190","messageId":"xmqq4jej6i1b.fsf@gitster.g","threadId":"60699","inReplyTo":"a718b5ee-afb0-44bd-a299-3208fac43506@smtp-relay.sendinblue.com","subject":"Re: [PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-07T22:12:00Z","receivedAt":"2024-02-07T22:12:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Britton Leo Kerin\" <britton.kerin@gmail.com> writes:\n\n> In this case the user has specifically said they don't want send-email\n> to run format-patch so revs aren't valid argument completions (and it's\n> likely revs and dirs do have some same names or prefixes as in\n> Documentation/MyFirstContribution.txt 'psuh').\n>\n> Signed-off-by: Britton Leo Kerin <britton.kerin@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n\nAny reviews people want to offer to this one?\n\nThanks.\n\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 185b47d802..c983f3b2ab 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1242,10 +1242,12 @@ __git_find_last_on_cmdline ()\n>  \twhile test $# -gt 1; do\n>  \t\tcase \"$1\" in\n>  \t\t--show-idx)\tshow_idx=y ;;\n> +\t\t--)\t\tshift && break ;;\n>  \t\t*)\t\treturn 1 ;;\n>  \t\tesac\n>  \t\tshift\n>  \tdone\n> +\t[ $# -eq 1 ] || return 1   # return 1 if we got wrong # of non-opts\n>  \tlocal wordlist=\"$1\"\n>  \n>  \twhile [ $c -gt \"$__git_cmd_idx\" ]; do\n> @@ -2429,7 +2431,9 @@ _git_send_email ()\n>  \t\treturn\n>  \t\t;;\n>  \tesac\n> -\t__git_complete_revlist\n> +\tif [ \"$(__git_find_last_on_cmdline -- \"--format-patch --no-format-patch\")\" != \"--no-format-patch\" ]; then\n> +\t\t__git_complete_revlist\n> +\tfi\n>  }\n>  \n>  _git_stage ()\n"},{"id":"488217","messageId":"ZcSJaRczdHApmnVi@tanuki","threadId":"60699","inReplyTo":"a718b5ee-afb0-44bd-a299-3208fac43506@smtp-relay.sendinblue.com","subject":"Re: [PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-02-08T07:57:29Z","receivedAt":"2024-02-08T07:57:34Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Jan 08, 2024 at 04:08:30PM -0900, Britton Leo Kerin wrote:\n> In this case the user has specifically said they don't want send-email\n> to run format-patch so revs aren't valid argument completions (and it's\n> likely revs and dirs do have some same names or prefixes as in\n> Documentation/MyFirstContribution.txt 'psuh').\n> \n> Signed-off-by: Britton Leo Kerin <britton.kerin@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 185b47d802..c983f3b2ab 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1242,10 +1242,12 @@ __git_find_last_on_cmdline ()\n>  \twhile test $# -gt 1; do\n>  \t\tcase \"$1\" in\n>  \t\t--show-idx)\tshow_idx=y ;;\n> +\t\t--)\t\tshift && break ;;\n>  \t\t*)\t\treturn 1 ;;\n>  \t\tesac\n>  \t\tshift\n>  \tdone\n> +\t[ $# -eq 1 ] || return 1   # return 1 if we got wrong # of non-opts\n>  \tlocal wordlist=\"$1\"\n>  \n>  \twhile [ $c -gt \"$__git_cmd_idx\" ]; do\n> @@ -2429,7 +2431,9 @@ _git_send_email ()\n>  \t\treturn\n>  \t\t;;\n>  \tesac\n> -\t__git_complete_revlist\n> +\tif [ \"$(__git_find_last_on_cmdline -- \"--format-patch --no-format-patch\")\" != \"--no-format-patch\" ]; then\n> +\t\t__git_complete_revlist\n> +\tfi\n>  }\n\nWhile this second hunk here makes perfect sense to me, there is no\nexplanation why we need to change `__git_find_last_on_cmdline ()`. It's\nalready used with \"--guess --no-guess\" in another place, so I would\nthink that it ought to work alright for this usecase, too. Or is it that\nthe existing callsite of this function is buggy, too? If so, we should\nlikely fix that in a separate patch together with a test.\n\nAlso, adding a test for git-send-email that exercises this new behaviour\nwould be very much welcome, too.\n\nPatrick\n"},{"id":"488669","messageId":"CAC4O8c88Z3ZqxH2VVaNPpEGB3moL5dJcg3cOWuLWwQ_hLrJMtA@mail.gmail.com","threadId":"60699","inReplyTo":"ZcSJaRczdHApmnVi@tanuki","subject":"Re: [PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Britton Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2024-02-14T20:49:08Z","receivedAt":"2024-02-14T20:49:21Z","isPatch":true,"sender":{"key":"britton.kerin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7434164?v=4"},"body":"On Wed, Feb 7, 2024 at 10:57 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Mon, Jan 08, 2024 at 04:08:30PM -0900, Britton Leo Kerin wrote:\n> > In this case the user has specifically said they don't want send-email\n> > to run format-patch so revs aren't valid argument completions (and it's\n> > likely revs and dirs do have some same names or prefixes as in\n> > Documentation/MyFirstContribution.txt 'psuh').\n> >\n> > Signed-off-by: Britton Leo Kerin <britton.kerin@gmail.com>\n> > ---\n> >  contrib/completion/git-completion.bash | 6 +++++-\n> >  1 file changed, 5 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> > index 185b47d802..c983f3b2ab 100644\n> > --- a/contrib/completion/git-completion.bash\n> > +++ b/contrib/completion/git-completion.bash\n> > @@ -1242,10 +1242,12 @@ __git_find_last_on_cmdline ()\n> >       while test $# -gt 1; do\n> >               case \"$1\" in\n> >               --show-idx)     show_idx=y ;;\n> > +             --)             shift && break ;;\n> >               *)              return 1 ;;\n> >               esac\n> >               shift\n> >       done\n> > +     [ $# -eq 1 ] || return 1   # return 1 if we got wrong # of non-opts\n> >       local wordlist=\"$1\"\n> >\n> >       while [ $c -gt \"$__git_cmd_idx\" ]; do\n> > @@ -2429,7 +2431,9 @@ _git_send_email ()\n> >               return\n> >               ;;\n> >       esac\n> > -     __git_complete_revlist\n> > +     if [ \"$(__git_find_last_on_cmdline -- \"--format-patch --no-format-patch\")\" != \"--no-format-patch\" ]; then\n> > +             __git_complete_revlist\n> > +     fi\n> >  }\n>\n> While this second hunk here makes perfect sense to me, there is no\n> explanation why we need to change `__git_find_last_on_cmdline ()`. It's\n> already used with \"--guess --no-guess\" in another place, so I would\n> think that it ought to work alright for this usecase, too. Or is it that\n> the existing callsite of this function is buggy, too? If so, we should\n> likely fix that in a separate patch together with a test.\n>\n> Also, adding a test for git-send-email that exercises this new behaviour\n> would be very much welcome, too.\n\nI'll look this one over again and add some tests eventually.\n\nBritton\n"},{"id":"489044","messageId":"xmqqa5nusiqv.fsf@gitster.g","threadId":"60699","inReplyTo":"CAC4O8c88Z3ZqxH2VVaNPpEGB3moL5dJcg3cOWuLWwQ_hLrJMtA@mail.gmail.com","subject":"Re: [PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-21T01:34:16Z","receivedAt":"2024-02-21T01:34:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Britton Kerin <britton.kerin@gmail.com> writes:\n\n>> While this second hunk here makes perfect sense to me, there is no\n>> explanation why we need to change `__git_find_last_on_cmdline ()`. It's\n>> already used with \"--guess --no-guess\" in another place, so I would\n>> think that it ought to work alright for this usecase, too. Or is it that\n>> the existing callsite of this function is buggy, too? If so, we should\n>> likely fix that in a separate patch together with a test.\n>>\n>> Also, adding a test for git-send-email that exercises this new behaviour\n>> would be very much welcome, too.\n>\n> I'll look this one over again and add some tests eventually.\n\nThank you, both.\n\n"},{"id":"490022","messageId":"xmqqfrx4z6gg.fsf@gitster.g","threadId":"60699","inReplyTo":"CAC4O8c88Z3ZqxH2VVaNPpEGB3moL5dJcg3cOWuLWwQ_hLrJMtA@mail.gmail.com","subject":"Re: [PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T21:58:39Z","receivedAt":"2024-03-05T21:58:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Britton Kerin <britton.kerin@gmail.com> writes:\n\n> On Wed, Feb 7, 2024 at 10:57 PM Patrick Steinhardt <ps@pks.im> wrote:\n>> ...\n>> Also, adding a test for git-send-email that exercises this new behaviour\n>> would be very much welcome, too.\n>\n> I'll look this one over again and add some tests eventually.\n\nJust pinging the thread to keep it visible in the list of recent\ntopics I need to keep an eye on.  No rush.\n\nThanks.\n"},{"id":"493574","messageId":"xmqqplu92j3e.fsf@gitster.g","threadId":"60699","inReplyTo":"CAC4O8c88Z3ZqxH2VVaNPpEGB3moL5dJcg3cOWuLWwQ_hLrJMtA@mail.gmail.com","subject":"Re: [PATCH v2 1/1] completion: don't complete revs when --no-format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-28T22:55:17Z","receivedAt":"2024-04-28T22:55:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Britton Kerin <britton.kerin@gmail.com> writes:\n\n> On Wed, Feb 7, 2024 at 10:57 PM Patrick Steinhardt <ps@pks.im> wrote:\n>>\n>> On Mon, Jan 08, 2024 at 04:08:30PM -0900, Britton Leo Kerin wrote:\n>> ...\n>> While this second hunk here makes perfect sense to me, there is no\n>> explanation why we need to change `__git_find_last_on_cmdline ()`. It's\n>> already used with \"--guess --no-guess\" in another place, so I would\n>> think that it ought to work alright for this usecase, too. Or is it that\n>> the existing callsite of this function is buggy, too? If so, we should\n>> likely fix that in a separate patch together with a test.\n>>\n>> Also, adding a test for git-send-email that exercises this new behaviour\n>> would be very much welcome, too.\n>\n> I'll look this one over again and add some tests eventually.\n\nIt has been a while, but is there any progress on this topic?\n\nThanks.\n"}]}