* [PATCH] completion: add option --recurse-submodules to "git push"
@ 2012-12-07 12:28 Steffen Jaeckel
2012-12-07 17:21 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Steffen Jaeckel @ 2012-12-07 12:28 UTC (permalink / raw)
To: git; +Cc: Steffen Jaeckel
Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>
---
contrib/completion/git-completion.bash | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0b77eb1..5b4d2e1 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1434,6 +1434,10 @@ _git_pull ()
__git_complete_remote_or_refspec
}
+__git_push_recurse_submodules_options="
+ check on-demand
+"
+
_git_push ()
{
case "$prev" in
@@ -1446,10 +1450,15 @@ _git_push ()
__gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}"
return
;;
+ --recurse-submodules=*)
+ __gitcomp "$__git_push_recurse_submodules_options" "" "${cur##--recurse-submodules=}"
+ return
+ ;;
--*)
__gitcomp "
--all --mirror --tags --dry-run --force --verbose
--receive-pack= --repo= --set-upstream
+ --recurse-submodules=
"
return
;;
--
1.8.0.msysgit.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] completion: add option --recurse-submodules to "git push"
2012-12-07 12:28 [PATCH] completion: add option --recurse-submodules to "git push" Steffen Jaeckel
@ 2012-12-07 17:21 ` Junio C Hamano
2012-12-12 22:30 ` Felipe Contreras
2012-12-18 17:59 ` Heiko Voigt
0 siblings, 2 replies; 4+ messages in thread
From: Junio C Hamano @ 2012-12-07 17:21 UTC (permalink / raw)
To: Steffen Jaeckel; +Cc: git, Heiko Voigt, Felipe Contreras
Steffen Jaeckel <steffen.jaeckel@stzedn.de> writes:
> Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>
> ---
> contrib/completion/git-completion.bash | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 0b77eb1..5b4d2e1 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1434,6 +1434,10 @@ _git_pull ()
> __git_complete_remote_or_refspec
> }
>
> +__git_push_recurse_submodules_options="
> + check on-demand
> +"
Most of the existing completion functions do not seem to define
separate variables like this; instead, they literally embed their
choices at the point of use.
Is it expected that the same set of choices will appear in the
completion of many other subcommand options? [jc: Cc'ed Heiko so
that we can sanity check the answer to this question]. If so, the
variable may be justified; otherwise, not.
> _git_push ()
> {
> case "$prev" in
> @@ -1446,10 +1450,15 @@ _git_push ()
> __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}"
> return
> ;;
> + --recurse-submodules=*)
> + __gitcomp "$__git_push_recurse_submodules_options" "" "${cur##--recurse-submodules=}"
> + return
> + ;;
Owners of the completion script, does this look reasonable?
[jc: Cc'ed Felipe for this]
This is a tangent, but why is it a double-hash "##" not a
single-hash "#", other than "because all others use ##"?
> --*)
> __gitcomp "
> --all --mirror --tags --dry-run --force --verbose
> --receive-pack= --repo= --set-upstream
> + --recurse-submodules=
> "
> return
> ;;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] completion: add option --recurse-submodules to "git push"
2012-12-07 17:21 ` Junio C Hamano
@ 2012-12-12 22:30 ` Felipe Contreras
2012-12-18 17:59 ` Heiko Voigt
1 sibling, 0 replies; 4+ messages in thread
From: Felipe Contreras @ 2012-12-12 22:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Steffen Jaeckel, git, Heiko Voigt
On Fri, Dec 7, 2012 at 11:21 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Steffen Jaeckel <steffen.jaeckel@stzedn.de> writes:
>
>> Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>
>> ---
>> contrib/completion/git-completion.bash | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 0b77eb1..5b4d2e1 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -1434,6 +1434,10 @@ _git_pull ()
>> __git_complete_remote_or_refspec
>> }
>>
>> +__git_push_recurse_submodules_options="
>> + check on-demand
>> +"
>
> Most of the existing completion functions do not seem to define
> separate variables like this; instead, they literally embed their
> choices at the point of use.
>
> Is it expected that the same set of choices will appear in the
> completion of many other subcommand options? [jc: Cc'ed Heiko so
> that we can sanity check the answer to this question]. If so, the
> variable may be justified; otherwise, not.
>
>> _git_push ()
>> {
>> case "$prev" in
>> @@ -1446,10 +1450,15 @@ _git_push ()
>> __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}"
>> return
>> ;;
>> + --recurse-submodules=*)
>> + __gitcomp "$__git_push_recurse_submodules_options" "" "${cur##--recurse-submodules=}"
>> + return
>> + ;;
>
> Owners of the completion script, does this look reasonable?
> [jc: Cc'ed Felipe for this]
>
> This is a tangent, but why is it a double-hash "##" not a
> single-hash "#", other than "because all others use ##"?
Seems OK by me, but I agree, the options should be inline.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: [PATCH] completion: add option --recurse-submodules to "git push"
2012-12-07 17:21 ` Junio C Hamano
2012-12-12 22:30 ` Felipe Contreras
@ 2012-12-18 17:59 ` Heiko Voigt
1 sibling, 0 replies; 4+ messages in thread
From: Heiko Voigt @ 2012-12-18 17:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Steffen Jaeckel, git, Felipe Contreras, Jens Lehmann
Hi,
sorry for the late reply.
On Fri, Dec 07, 2012 at 09:21:33AM -0800, Junio C Hamano wrote:
> Steffen Jaeckel <steffen.jaeckel@stzedn.de> writes:
>
> > Signed-off-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>
> > ---
> > contrib/completion/git-completion.bash | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index 0b77eb1..5b4d2e1 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1434,6 +1434,10 @@ _git_pull ()
> > __git_complete_remote_or_refspec
> > }
> >
> > +__git_push_recurse_submodules_options="
> > + check on-demand
> > +"
>
> Most of the existing completion functions do not seem to define
> separate variables like this; instead, they literally embed their
> choices at the point of use.
>
> Is it expected that the same set of choices will appear in the
> completion of many other subcommand options? [jc: Cc'ed Heiko so
> that we can sanity check the answer to this question]. If so, the
> variable may be justified; otherwise, not.
No I think not. At least not exactly the same. check will be limited to
push since it only makes sense there. on-demand on the other hand is
already used for fetch and pull. Currently no more possible uses come to
my mind. checkout and others will learn to traverse submodules but that will
most likely be a boolean (to switch it on and off).
CC'ed Jens so he can also take a look.
Cheers Heiko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-18 18:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 12:28 [PATCH] completion: add option --recurse-submodules to "git push" Steffen Jaeckel
2012-12-07 17:21 ` Junio C Hamano
2012-12-12 22:30 ` Felipe Contreras
2012-12-18 17:59 ` Heiko Voigt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).