{"thread":{"id":"60700","subject":"[PATCH 1/1] completion: don't comp revs when --no-format-patch","startedAt":"2024-01-08T09:36:06Z","lastAt":"2024-01-08T18:39:57Z","messageCount":2,"participants":["Britton Leo Kerin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"486383","messageId":"ce76a31e-d435-477e-803c-92d0532174eb@smtp-relay.sendinblue.com","threadId":"60700","inReplyTo":"20240108093601.136370-1-britton.kerin@gmail.com","subject":"[PATCH 1/1] completion: don't comp revs when --no-format-patch","fromName":"Britton Leo Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2024-01-08T09:36:01Z","receivedAt":"2024-01-08T09:36:06Z","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":"486406","messageId":"xmqqplybk6th.fsf@gitster.g","threadId":"60700","inReplyTo":"ce76a31e-d435-477e-803c-92d0532174eb@smtp-relay.sendinblue.com","subject":"Re: [PATCH 1/1] completion: don't comp revs when --no-format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-01-08T18:39:54Z","receivedAt":"2024-01-08T18:39:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">Subject: Re: [PATCH 1/1] completion: don't comp revs when --no-format-patch\n\nI suspect \"comp revs\" -> \"complete revs\" is what you meant, but\nif so, please spell it out to help folks who read \"git shortlog --no-merges\"\noutput, i.e. without help from the body of the log message.\n\n\n\n\n"}]}