{"thread":{"id":"32284","subject":"[PATCH] completion: add option --recurse-submodules to \"git push\"","startedAt":"2012-12-07T12:28:24Z","lastAt":"2012-12-18T17:59:42Z","messageCount":4,"participants":["Steffen Jaeckel","Junio C Hamano","Felipe Contreras","Heiko Voigt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"204570","messageId":"1354883304-6860-1-git-send-email-steffen.jaeckel@stzedn.de","threadId":"32284","inReplyTo":null,"subject":"[PATCH] completion: add option --recurse-submodules to \"git push\"","fromName":"Steffen Jaeckel","fromEmail":"steffen.jaeckel@stzedn.de","sentAt":"2012-12-07T12:28:24Z","receivedAt":"2012-12-07T12:28:24Z","isPatch":true,"sender":{"key":"steffen.jaeckel@stzedn.de","avatar":"https://gravatar.com/avatar/12d8a352f2825a89f36bd8d4a5742311b23d75a446c096949afa4a9f16274bf4?d=mp&s=160"},"body":"Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>\n---\n contrib/completion/git-completion.bash | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 0b77eb1..5b4d2e1 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1434,6 +1434,10 @@ _git_pull ()\n \t__git_complete_remote_or_refspec\n }\n \n+__git_push_recurse_submodules_options=\"\n+\tcheck on-demand\n+\"\n+\n _git_push ()\n {\n \tcase \"$prev\" in\n@@ -1446,10 +1450,15 @@ _git_push ()\n \t\t__gitcomp_nl \"$(__git_remotes)\" \"\" \"${cur##--repo=}\"\n \t\treturn\n \t\t;;\n+\t--recurse-submodules=*)\n+\t\t__gitcomp \"$__git_push_recurse_submodules_options\" \"\" \"${cur##--recurse-submodules=}\"\n+\t\treturn\n+\t\t;;\n \t--*)\n \t\t__gitcomp \"\n \t\t\t--all --mirror --tags --dry-run --force --verbose\n \t\t\t--receive-pack= --repo= --set-upstream\n+\t\t\t--recurse-submodules=\n \t\t\"\n \t\treturn\n \t\t;;\n-- \n1.8.0.msysgit.0\n"},{"id":"204575","messageId":"7vehj1ixr6.fsf@alter.siamese.dyndns.org","threadId":"32284","inReplyTo":"1354883304-6860-1-git-send-email-steffen.jaeckel@stzedn.de","subject":"Re: [PATCH] completion: add option --recurse-submodules to \"git push\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-07T17:21:33Z","receivedAt":"2012-12-07T17:21:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steffen Jaeckel <steffen.jaeckel@stzedn.de> writes:\n\n> Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>\n> ---\n>  contrib/completion/git-completion.bash | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 0b77eb1..5b4d2e1 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1434,6 +1434,10 @@ _git_pull ()\n>  \t__git_complete_remote_or_refspec\n>  }\n>  \n> +__git_push_recurse_submodules_options=\"\n> +\tcheck on-demand\n> +\"\n\nMost of the existing completion functions do not seem to define\nseparate variables like this; instead, they literally embed their\nchoices at the point of use.\n\nIs it expected that the same set of choices will appear in the\ncompletion of many other subcommand options?  [jc: Cc'ed Heiko so\nthat we can sanity check the answer to this question].  If so, the\nvariable may be justified; otherwise, not.\n\n>  _git_push ()\n>  {\n>  \tcase \"$prev\" in\n> @@ -1446,10 +1450,15 @@ _git_push ()\n>  \t\t__gitcomp_nl \"$(__git_remotes)\" \"\" \"${cur##--repo=}\"\n>  \t\treturn\n>  \t\t;;\n> +\t--recurse-submodules=*)\n> +\t\t__gitcomp \"$__git_push_recurse_submodules_options\" \"\" \"${cur##--recurse-submodules=}\"\n> +\t\treturn\n> +\t\t;;\n\nOwners of the completion script, does this look reasonable?\n[jc: Cc'ed Felipe for this]\n\nThis is a tangent, but why is it a double-hash \"##\" not a\nsingle-hash \"#\", other than \"because all others use ##\"?\n\n>  \t--*)\n>  \t\t__gitcomp \"\n>  \t\t\t--all --mirror --tags --dry-run --force --verbose\n>  \t\t\t--receive-pack= --repo= --set-upstream\n> +\t\t\t--recurse-submodules=\n>  \t\t\"\n>  \t\treturn\n>  \t\t;;\n"},{"id":"204789","messageId":"CAMP44s2GYoR1fM-jEj9inO58ATgix5FuZouqZg2+tU47BOaTew@mail.gmail.com","threadId":"32284","inReplyTo":"7vehj1ixr6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] completion: add option --recurse-submodules to \"git push\"","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-12-12T22:30:40Z","receivedAt":"2012-12-12T22:30:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Dec 7, 2012 at 11:21 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Steffen Jaeckel <steffen.jaeckel@stzedn.de> writes:\n>\n>> Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>\n>> ---\n>>  contrib/completion/git-completion.bash | 9 +++++++++\n>>  1 file changed, 9 insertions(+)\n>>\n>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n>> index 0b77eb1..5b4d2e1 100644\n>> --- a/contrib/completion/git-completion.bash\n>> +++ b/contrib/completion/git-completion.bash\n>> @@ -1434,6 +1434,10 @@ _git_pull ()\n>>       __git_complete_remote_or_refspec\n>>  }\n>>\n>> +__git_push_recurse_submodules_options=\"\n>> +     check on-demand\n>> +\"\n>\n> Most of the existing completion functions do not seem to define\n> separate variables like this; instead, they literally embed their\n> choices at the point of use.\n>\n> Is it expected that the same set of choices will appear in the\n> completion of many other subcommand options?  [jc: Cc'ed Heiko so\n> that we can sanity check the answer to this question].  If so, the\n> variable may be justified; otherwise, not.\n>\n>>  _git_push ()\n>>  {\n>>       case \"$prev\" in\n>> @@ -1446,10 +1450,15 @@ _git_push ()\n>>               __gitcomp_nl \"$(__git_remotes)\" \"\" \"${cur##--repo=}\"\n>>               return\n>>               ;;\n>> +     --recurse-submodules=*)\n>> +             __gitcomp \"$__git_push_recurse_submodules_options\" \"\" \"${cur##--recurse-submodules=}\"\n>> +             return\n>> +             ;;\n>\n> Owners of the completion script, does this look reasonable?\n> [jc: Cc'ed Felipe for this]\n>\n> This is a tangent, but why is it a double-hash \"##\" not a\n> single-hash \"#\", other than \"because all others use ##\"?\n\nSeems OK by me, but I agree, the options should be inline.\n\n-- \nFelipe Contreras\n"},{"id":"205139","messageId":"20121218175942.GA26151@book.hvoigt.net","threadId":"32284","inReplyTo":"7vehj1ixr6.fsf@alter.siamese.dyndns.org","subject":"Re: Re: [PATCH] completion: add option --recurse-submodules to \"git push\"","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2012-12-18T17:59:42Z","receivedAt":"2012-12-18T17:59:42Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"Hi,\n\nsorry for the late reply.\n\nOn Fri, Dec 07, 2012 at 09:21:33AM -0800, Junio C Hamano wrote:\n> Steffen Jaeckel <steffen.jaeckel@stzedn.de> writes:\n> \n> > Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>\n> > ---\n> >  contrib/completion/git-completion.bash | 9 +++++++++\n> >  1 file changed, 9 insertions(+)\n> >\n> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> > index 0b77eb1..5b4d2e1 100644\n> > --- a/contrib/completion/git-completion.bash\n> > +++ b/contrib/completion/git-completion.bash\n> > @@ -1434,6 +1434,10 @@ _git_pull ()\n> >  \t__git_complete_remote_or_refspec\n> >  }\n> >  \n> > +__git_push_recurse_submodules_options=\"\n> > +\tcheck on-demand\n> > +\"\n> \n> Most of the existing completion functions do not seem to define\n> separate variables like this; instead, they literally embed their\n> choices at the point of use.\n> \n> Is it expected that the same set of choices will appear in the\n> completion of many other subcommand options?  [jc: Cc'ed Heiko so\n> that we can sanity check the answer to this question].  If so, the\n> variable may be justified; otherwise, not.\n\nNo I think not. At least not exactly the same. check will be limited to\npush since it only makes sense there. on-demand on the other hand is\nalready used for fetch and pull. Currently no more possible uses come to\nmy mind. checkout and others will learn to traverse submodules but that will\nmost likely be a boolean (to switch it on and off).\n\nCC'ed Jens so he can also take a look.\n\nCheers Heiko\n"}]}