{"thread":{"id":"54248","subject":"[PATCH] contrib/completion: complete options that take refs for format-patch","startedAt":"2020-09-17T08:06:40Z","lastAt":"2020-09-17T08:06:40Z","messageCount":1,"participants":["Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"405729","messageId":"6b5eac1d20781eecbadf3c3b0c0e34b7cf57134b.1600329854.git.liu.denton@gmail.com","threadId":"54248","inReplyTo":null,"subject":"[PATCH] contrib/completion: complete options that take refs for format-patch","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2020-09-17T08:04:36Z","receivedAt":"2020-09-17T08:06:40Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"The completion for format-patch currently suggests --base=, --interdiff=\nand --range-diff= as options. However, with these `=` forms of the\noptions, there is no space and we'd enter the `--*` case which means we\ndon't call the __git_complete_revlist() at the end.\n\nTeach _git_format_patch() to complete refs in the case of --base=,\n--interdiff= and --range-diff=.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n contrib/completion/git-completion.bash | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9147fba3d5..8be4a0316e 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1784,6 +1784,10 @@ _git_format_patch ()\n \t\t\t\" \"\" \"${cur##--thread=}\"\n \t\treturn\n \t\t;;\n+\t--base=*|--interdiff=*|--range-diff=*)\n+\t\t__git_complete_refs --cur=\"${cur#--*=}\"\n+\t\treturn\n+\t\t;;\n \t--*)\n \t\t__gitcomp_builtin format-patch \"$__git_format_patch_extra_options\"\n \t\treturn\n-- \n2.28.0.618.gf4bc123cb7\n\n"}]}