{"thread":{"id":"49627","subject":"[PATCH] completion: use __gitcomp_builtin for format-patch","startedAt":"2018-10-21T08:41:27Z","lastAt":"2018-10-22T14:25:57Z","messageCount":4,"participants":["Nguyễn Thái Ngọc Duy","SZEDER Gábor","Johannes Schindelin","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"361086","messageId":"20181021084102.8318-1-pclouds@gmail.com","threadId":"49627","inReplyTo":null,"subject":"[PATCH] completion: use __gitcomp_builtin for format-patch","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-10-21T08:41:02Z","receivedAt":"2018-10-21T08:41:27Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This helps format-patch gain completion for a couple new options,\nnotably --range-diff.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Of course it will be even better if I could complete the ref for\n --range-diff=, but maybe another day.\n\n contrib/completion/git-completion.bash | 10 +++-------\n 1 file changed, 3 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex c8fdcf8644..065b922777 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1533,12 +1533,8 @@ _git_fetch ()\n }\n \n __git_format_patch_options=\"\n-\t--stdout --attach --no-attach --thread --thread= --no-thread\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-\t--output-directory --reroll-count --to= --quiet --notes\n+\t--full-index --not --all --no-prefix --src-prefix=\n+\t--dst-prefix= --notes\n \"\n \n _git_format_patch ()\n@@ -1551,7 +1547,7 @@ _git_format_patch ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"$__git_format_patch_options\"\n+\t\t__gitcomp_builtin format-patch \"$__git_format_patch_options\"\n \t\treturn\n \t\t;;\n \tesac\n-- \n2.19.1.647.g708186aaf9\n\n"},{"id":"361151","messageId":"20181022101719.GE30222@szeder.dev","threadId":"49627","inReplyTo":"20181021084102.8318-1-pclouds@gmail.com","subject":"Re: [PATCH] completion: use __gitcomp_builtin for format-patch","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-10-22T10:17:19Z","receivedAt":"2018-10-22T10:17:25Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Oct 21, 2018 at 10:41:02AM +0200, Nguyễn Thái Ngọc Duy wrote:\n> This helps format-patch gain completion for a couple new options,\n> notably --range-diff.\n> \n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  Of course it will be even better if I could complete the ref for\n>  --range-diff=, but maybe another day.\n> \n>  contrib/completion/git-completion.bash | 10 +++-------\n>  1 file changed, 3 insertions(+), 7 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index c8fdcf8644..065b922777 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1533,12 +1533,8 @@ _git_fetch ()\n>  }\n>  \n>  __git_format_patch_options=\"\n> -\t--stdout --attach --no-attach --thread --thread= --no-thread\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> -\t--output-directory --reroll-count --to= --quiet --notes\n> +\t--full-index --not --all --no-prefix --src-prefix=\n> +\t--dst-prefix= --notes\n>  \"\n\n$__git_format_patch_options is also used when completing 'git\nsend-email's options, thus removing all these options will badly\naffect that, and in fact makes 't9902-completion.sh' fail with:\n\n  expecting success:\n          test_completion \"git send-email --cov\" \"--cover-letter \" &&\n          test_completion \"git send-email ma\" \"master \"\n  \n  --- expected    2018-10-22 09:03:42.255325418 +0000\n  +++ out_sorted  2018-10-22 09:03:42.255325418 +0000\n  @@ -1 +1 @@\n  ---cover-letter\n  +\n  not ok 122 - send-email\n  #\n  #               test_completion \"git send-email --cov\" \"--cover-letter \" &&\n  #               test_completion \"git send-email ma\" \"master \"\n  #\n\n\n>  _git_format_patch ()\n> @@ -1551,7 +1547,7 @@ _git_format_patch ()\n>  \t\treturn\n>  \t\t;;\n>  \t--*)\n> -\t\t__gitcomp \"$__git_format_patch_options\"\n> +\t\t__gitcomp_builtin format-patch \"$__git_format_patch_options\"\n\nYou sent out a separate bugfix patch (i.e. not a patch series)\n\"completion: fix __gitcomp_builtin no longer consider extra options\"\nin:\n\n  https://public-inbox.org/git/20181021083731.8009-1-pclouds@gmail.com/\n\nand this patch makes the completion of 'git format-patch' also use\nextra options...  So, does this patch really work without that bugfix?\n\n>  \t\treturn\n>  \t\t;;\n>  \tesac\n> -- \n> 2.19.1.647.g708186aaf9\n> \n"},{"id":"361154","messageId":"nycvar.QRO.7.76.6.1810221411220.4546@tvgsbejvaqbjf.bet","threadId":"49627","inReplyTo":"20181021084102.8318-1-pclouds@gmail.com","subject":"Re: [PATCH] completion: use __gitcomp_builtin for format-patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-10-22T12:12:14Z","receivedAt":"2018-10-22T12:12:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Duy,\n\nOn Sun, 21 Oct 2018, Nguyễn Thái Ngọc Duy wrote:\n\n> This helps format-patch gain completion for a couple new options,\n> notably --range-diff.\n> \n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  Of course it will be even better if I could complete the ref for\n>  --range-diff=, but maybe another day.\n> \n>  contrib/completion/git-completion.bash | 10 +++-------\n>  1 file changed, 3 insertions(+), 7 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index c8fdcf8644..065b922777 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1533,12 +1533,8 @@ _git_fetch ()\n>  }\n>  \n>  __git_format_patch_options=\"\n> -\t--stdout --attach --no-attach --thread --thread= --no-thread\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> -\t--output-directory --reroll-count --to= --quiet --notes\n> +\t--full-index --not --all --no-prefix --src-prefix=\n> +\t--dst-prefix= --notes\n>  \"\n>  \n>  _git_format_patch ()\n> @@ -1551,7 +1547,7 @@ _git_format_patch ()\n>  \t\treturn\n>  \t\t;;\n>  \t--*)\n> -\t\t__gitcomp \"$__git_format_patch_options\"\n> +\t\t__gitcomp_builtin format-patch \"$__git_format_patch_options\"\n\nIs it just me, or does this fail t9902 for you, too, where it wants to\ncomplete the --cover-letter option for *send-email* (not for\n*format-patch*)?\n\nSee e.g.\nhttps://git-for-windows.visualstudio.com/git/_build/results?buildId=22023&view=logs\n\nCiao,\nDscho\n\n>  \t\treturn\n>  \t\t;;\n>  \tesac\n> -- \n> 2.19.1.647.g708186aaf9\n> \n> \n> "},{"id":"361160","messageId":"CACsJy8DUrVJu0HN7kuCeo4iV5aimWbYtr+E-7kenPVDx90DpGw@mail.gmail.com","threadId":"49627","inReplyTo":"20181022101719.GE30222@szeder.dev","subject":"Re: [PATCH] completion: use __gitcomp_builtin for format-patch","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-10-22T14:25:27Z","receivedAt":"2018-10-22T14:25:57Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Oct 22, 2018 at 12:17 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n>\n> On Sun, Oct 21, 2018 at 10:41:02AM +0200, Nguyễn Thái Ngọc Duy wrote:\n> > This helps format-patch gain completion for a couple new options,\n> > notably --range-diff.\n> >\n> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> > ---\n> >  Of course it will be even better if I could complete the ref for\n> >  --range-diff=, but maybe another day.\n> >\n> >  contrib/completion/git-completion.bash | 10 +++-------\n> >  1 file changed, 3 insertions(+), 7 deletions(-)\n> >\n> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> > index c8fdcf8644..065b922777 100644\n> > --- a/contrib/completion/git-completion.bash\n> > +++ b/contrib/completion/git-completion.bash\n> > @@ -1533,12 +1533,8 @@ _git_fetch ()\n> >  }\n> >\n> >  __git_format_patch_options=\"\n> > -     --stdout --attach --no-attach --thread --thread= --no-thread\n> > -     --numbered --start-number --numbered-files --keep-subject --signoff\n> > -     --signature --no-signature --in-reply-to= --cc= --full-index --binary\n> > -     --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=\n> > -     --inline --suffix= --ignore-if-in-upstream --subject-prefix=\n> > -     --output-directory --reroll-count --to= --quiet --notes\n> > +     --full-index --not --all --no-prefix --src-prefix=\n> > +     --dst-prefix= --notes\n> >  \"\n>\n> $__git_format_patch_options is also used when completing 'git\n> send-email's options, thus removing all these options will badly\n> affect that, and in fact makes 't9902-completion.sh' fail with:\n\nOops. I guess I was excited about the other fix and forgot to test\nthis patch. Junio please kick it out of 'pu'.\n\nI'll need to think if I could somehow make send-email work without\nhardcoding a bunch of options in it.,,\n-- \nDuy\n"}]}