* [PATCH 1/4] completion: add missing terminator in case statement @ 2014-07-19 9:45 John Keeping 2014-07-19 9:45 ` [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` John Keeping ` (4 more replies) 0 siblings, 5 replies; 18+ messages in thread From: John Keeping @ 2014-07-19 9:45 UTC (permalink / raw) To: git; +Cc: John Keeping Signed-off-by: John Keeping <john@keeping.me.uk> --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 7a6e1d7..d0b2895 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1627,6 +1627,7 @@ _git_push () --repo) __gitcomp_nl "$(__git_remotes)" return + ;; esac case "$cur" in --repo=*) -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-19 9:45 [PATCH 1/4] completion: add missing terminator in case statement John Keeping @ 2014-07-19 9:45 ` John Keeping 2014-07-19 11:37 ` Johannes Sixt 2014-07-19 9:45 ` [PATCH 3/4] completion: add some missing options to `git push` John Keeping ` (3 subsequent siblings) 4 siblings, 1 reply; 18+ messages in thread From: John Keeping @ 2014-07-19 9:45 UTC (permalink / raw) To: git; +Cc: John Keeping Since the argument to `--recurse-submodules` is mandatory, it does not need to be stuck to the option with `=`. Signed-off-by: John Keeping <john@keeping.me.uk> --- contrib/completion/git-completion.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d0b2895..06211a6 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand" _git_push () { case "$prev" in + --recurse_submodules) + __gitcomp "$__git_push_recurse_submodules" + return + ;; --repo) __gitcomp_nl "$(__git_remotes)" return -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-19 9:45 ` [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` John Keeping @ 2014-07-19 11:37 ` Johannes Sixt 2014-07-19 15:10 ` John Keeping 0 siblings, 1 reply; 18+ messages in thread From: Johannes Sixt @ 2014-07-19 11:37 UTC (permalink / raw) To: John Keeping, git Am 19.07.2014 11:45, schrieb John Keeping: > Since the argument to `--recurse-submodules` is mandatory, it does not > need to be stuck to the option with `=`. > > Signed-off-by: John Keeping <john@keeping.me.uk> > --- > contrib/completion/git-completion.bash | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index d0b2895..06211a6 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand" > _git_push () > { > case "$prev" in > + --recurse_submodules) This would need a dash, not an underscore. > + __gitcomp "$__git_push_recurse_submodules" > + return > + ;; > --repo) > __gitcomp_nl "$(__git_remotes)" > return > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-19 11:37 ` Johannes Sixt @ 2014-07-19 15:10 ` John Keeping 0 siblings, 0 replies; 18+ messages in thread From: John Keeping @ 2014-07-19 15:10 UTC (permalink / raw) To: Johannes Sixt; +Cc: git On Sat, Jul 19, 2014 at 01:37:26PM +0200, Johannes Sixt wrote: > Am 19.07.2014 11:45, schrieb John Keeping: > > Since the argument to `--recurse-submodules` is mandatory, it does not > > need to be stuck to the option with `=`. > > > > Signed-off-by: John Keeping <john@keeping.me.uk> > > --- > > contrib/completion/git-completion.bash | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > > index d0b2895..06211a6 100644 > > --- a/contrib/completion/git-completion.bash > > +++ b/contrib/completion/git-completion.bash > > @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand" > > _git_push () > > { > > case "$prev" in > > + --recurse_submodules) > > This would need a dash, not an underscore. Thanks. I'll wait to see if there are any more comments before re-rolling. > > + __gitcomp "$__git_push_recurse_submodules" > > + return > > + ;; > > --repo) > > __gitcomp_nl "$(__git_remotes)" > > return > > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/4] completion: add some missing options to `git push` 2014-07-19 9:45 [PATCH 1/4] completion: add missing terminator in case statement John Keeping 2014-07-19 9:45 ` [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` John Keeping @ 2014-07-19 9:45 ` John Keeping 2014-07-19 9:45 ` [PATCH 4/4] completion: complete `git push --force-with-lease=` John Keeping ` (2 subsequent siblings) 4 siblings, 0 replies; 18+ messages in thread From: John Keeping @ 2014-07-19 9:45 UTC (permalink / raw) To: git; +Cc: John Keeping Signed-off-by: John Keeping <john@keeping.me.uk> --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 06211a6..9dcc222 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1645,6 +1645,7 @@ _git_push () --*) __gitcomp " --all --mirror --tags --dry-run --force --verbose + --quiet --prune --delete --follow-tags --receive-pack= --repo= --set-upstream --recurse-submodules= " -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/4] completion: complete `git push --force-with-lease=` 2014-07-19 9:45 [PATCH 1/4] completion: add missing terminator in case statement John Keeping 2014-07-19 9:45 ` [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 2014-07-19 9:45 ` [PATCH 3/4] completion: add some missing options to `git push` John Keeping @ 2014-07-19 9:45 ` John Keeping 2014-07-21 17:26 ` [PATCH 1/4] completion: add missing terminator in case statement Junio C Hamano 2014-07-22 18:24 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 4 siblings, 0 replies; 18+ messages in thread From: John Keeping @ 2014-07-19 9:45 UTC (permalink / raw) To: git; +Cc: John Keeping Signed-off-by: John Keeping <john@keeping.me.uk> --- contrib/completion/git-completion.bash | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9dcc222..ad0e75c 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1621,6 +1621,22 @@ _git_pull () __git_push_recurse_submodules="check on-demand" +__git_complete_force_with_lease () +{ + local cur_=$1 + + case "$cur_" in + --*=) + ;; + *:*) + __gitcomp_nl "$(__git_refs)" "" "${cur_#*:}" + ;; + *) + __gitcomp_nl "$(__git_refs)" "" "$cur_" + ;; + esac +} + _git_push () { case "$prev" in @@ -1634,6 +1650,10 @@ _git_push () ;; esac case "$cur" in + --force-with-lease=*) + __git_complete_force_with_lease "${cur##--force-with-lease=}" + return + ;; --repo=*) __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}" return @@ -1647,7 +1667,7 @@ _git_push () --all --mirror --tags --dry-run --force --verbose --quiet --prune --delete --follow-tags --receive-pack= --repo= --set-upstream - --recurse-submodules= + --force-with-lease --force-with-lease= --recurse-submodules= " return ;; -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 1/4] completion: add missing terminator in case statement 2014-07-19 9:45 [PATCH 1/4] completion: add missing terminator in case statement John Keeping ` (2 preceding siblings ...) 2014-07-19 9:45 ` [PATCH 4/4] completion: complete `git push --force-with-lease=` John Keeping @ 2014-07-21 17:26 ` Junio C Hamano 2014-07-21 20:09 ` Junio C Hamano 2014-07-22 18:24 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 4 siblings, 1 reply; 18+ messages in thread From: Junio C Hamano @ 2014-07-21 17:26 UTC (permalink / raw) To: John Keeping; +Cc: git John Keeping <john@keeping.me.uk> writes: > Signed-off-by: John Keeping <john@keeping.me.uk> > --- As these ;; are separators not terminators, this is not strictly necessary. Squashing it into a change that adds more case arms to this case statement is of course not just good but necessary, though. > contrib/completion/git-completion.bash | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 7a6e1d7..d0b2895 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1627,6 +1627,7 @@ _git_push () > --repo) > __gitcomp_nl "$(__git_remotes)" > return > + ;; > esac > case "$cur" in > --repo=*) ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/4] completion: add missing terminator in case statement 2014-07-21 17:26 ` [PATCH 1/4] completion: add missing terminator in case statement Junio C Hamano @ 2014-07-21 20:09 ` Junio C Hamano 2014-07-22 18:22 ` John Keeping 0 siblings, 1 reply; 18+ messages in thread From: Junio C Hamano @ 2014-07-21 20:09 UTC (permalink / raw) To: John Keeping; +Cc: git Junio C Hamano <gitster@pobox.com> writes: > John Keeping <john@keeping.me.uk> writes: > >> Signed-off-by: John Keeping <john@keeping.me.uk> >> --- > > As these ;; are separators not terminators, this is not strictly > necessary. Squashing it into a change that adds more case arms to > this case statement is of course not just good but necessary, > though. s/necessary/may be &/; if you add new arms before this one, you won't need it. But if you add one after this, you would ;-). >> contrib/completion/git-completion.bash | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash >> index 7a6e1d7..d0b2895 100644 >> --- a/contrib/completion/git-completion.bash >> +++ b/contrib/completion/git-completion.bash >> @@ -1627,6 +1627,7 @@ _git_push () >> --repo) >> __gitcomp_nl "$(__git_remotes)" >> return >> + ;; >> esac >> case "$cur" in >> --repo=*) ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/4] completion: add missing terminator in case statement 2014-07-21 20:09 ` Junio C Hamano @ 2014-07-22 18:22 ` John Keeping 2014-07-22 20:18 ` Junio C Hamano 0 siblings, 1 reply; 18+ messages in thread From: John Keeping @ 2014-07-22 18:22 UTC (permalink / raw) To: Junio C Hamano; +Cc: git On Mon, Jul 21, 2014 at 01:09:13PM -0700, Junio C Hamano wrote: > Junio C Hamano <gitster@pobox.com> writes: > > > John Keeping <john@keeping.me.uk> writes: > > > >> Signed-off-by: John Keeping <john@keeping.me.uk> > >> --- > > > > As these ;; are separators not terminators, this is not strictly > > necessary. Squashing it into a change that adds more case arms to > > this case statement is of course not just good but necessary, > > though. > > s/necessary/may be &/; if you add new arms before this one, you > won't need it. But if you add one after this, you would ;-). Hmm... POSIX describes them as terminators :-) The compound-list for each list of patterns, with the possible exception of the last, shall be terminated with ";;". Although, bash.info is inaccurate here (clearly Bash does implement the POSIX behaviour otherwise the existing code wouldn't work): Each clause must be terminated with `;;', `;&', or `;;&'. The WORD undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal before matching is attempted. Each PATTERN undergoes tilde expansion, parameter expansion, command substitution, and arithmetic expansion. There may be an arbitrary number of `case' clauses, each terminated by a `;;', `;&', or `;;&'. The first pattern that matches determines the command-list that is executed. I'll drop this patch in the re-roll since it isn't necessary. > >> contrib/completion/git-completion.bash | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > >> index 7a6e1d7..d0b2895 100644 > >> --- a/contrib/completion/git-completion.bash > >> +++ b/contrib/completion/git-completion.bash > >> @@ -1627,6 +1627,7 @@ _git_push () > >> --repo) > >> __gitcomp_nl "$(__git_remotes)" > >> return > >> + ;; > >> esac > >> case "$cur" in > >> --repo=*) ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/4] completion: add missing terminator in case statement 2014-07-22 18:22 ` John Keeping @ 2014-07-22 20:18 ` Junio C Hamano 0 siblings, 0 replies; 18+ messages in thread From: Junio C Hamano @ 2014-07-22 20:18 UTC (permalink / raw) To: John Keeping; +Cc: git John Keeping <john@keeping.me.uk> writes: > On Mon, Jul 21, 2014 at 01:09:13PM -0700, Junio C Hamano wrote: >> Junio C Hamano <gitster@pobox.com> writes: >> >> > John Keeping <john@keeping.me.uk> writes: >> > >> >> Signed-off-by: John Keeping <john@keeping.me.uk> >> >> --- >> > >> > As these ;; are separators not terminators, this is not strictly >> > necessary. Squashing it into a change that adds more case arms to >> > this case statement is of course not just good but necessary, >> > though. >> >> s/necessary/may be &/; if you add new arms before this one, you >> won't need it. But if you add one after this, you would ;-). > > Hmm... POSIX describes them as terminators :-) > > The compound-list for each list of patterns, with the possible > exception of the last, shall be terminated with ";;". A terminator that is optional at the end is a separator ;-). Having ';;' immediately before 'esac' is not wrong, but omitting it is exactly equally correct as having one, so it is not something we would want a patch to churn. > I'll drop this patch in the re-roll since it isn't necessary. This round looked good from a cursory read, except that the first one still makes me wonder why you chose to put it there _before_ where we handle --repo, where the corresponding case on "$cur" handles --repo= first and then --recurse-submodules= next. Wouldn't the end result easier to follow if you stuck to the same order? ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-19 9:45 [PATCH 1/4] completion: add missing terminator in case statement John Keeping ` (3 preceding siblings ...) 2014-07-21 17:26 ` [PATCH 1/4] completion: add missing terminator in case statement Junio C Hamano @ 2014-07-22 18:24 ` John Keeping 2014-07-22 18:24 ` [PATCH v2 2/3] completion: add some missing options to `git push` John Keeping ` (2 more replies) 4 siblings, 3 replies; 18+ messages in thread From: John Keeping @ 2014-07-22 18:24 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Johannes Sixt, John Keeping Since the argument to `--recurse-submodules` is mandatory, it does not need to be stuck to the option with `=`. Signed-off-by: John Keeping <john@keeping.me.uk> --- Change since v1: - Fix typo --recurse{_ => -}submodules - Dropped previous patch 1/4 adding ";;" at the end of the "--repo" case contrib/completion/git-completion.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 7a6e1d7..bed3665 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand" _git_push () { case "$prev" in + --recurse-submodules) + __gitcomp "$__git_push_recurse_submodules" + return + ;; --repo) __gitcomp_nl "$(__git_remotes)" return -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 2/3] completion: add some missing options to `git push` 2014-07-22 18:24 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` John Keeping @ 2014-07-22 18:24 ` John Keeping 2014-07-22 18:24 ` [PATCH v2 3/3] completion: complete `git push --force-with-lease=` John Keeping 2014-07-22 20:23 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` Junio C Hamano 2 siblings, 0 replies; 18+ messages in thread From: John Keeping @ 2014-07-22 18:24 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Johannes Sixt, John Keeping Signed-off-by: John Keeping <john@keeping.me.uk> --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index bed3665..33a4962 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1644,6 +1644,7 @@ _git_push () --*) __gitcomp " --all --mirror --tags --dry-run --force --verbose + --quiet --prune --delete --follow-tags --receive-pack= --repo= --set-upstream --recurse-submodules= " -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 3/3] completion: complete `git push --force-with-lease=` 2014-07-22 18:24 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 2014-07-22 18:24 ` [PATCH v2 2/3] completion: add some missing options to `git push` John Keeping @ 2014-07-22 18:24 ` John Keeping 2014-07-22 20:23 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` Junio C Hamano 2 siblings, 0 replies; 18+ messages in thread From: John Keeping @ 2014-07-22 18:24 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Johannes Sixt, John Keeping Signed-off-by: John Keeping <john@keeping.me.uk> --- contrib/completion/git-completion.bash | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 33a4962..293868a 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1621,6 +1621,22 @@ _git_pull () __git_push_recurse_submodules="check on-demand" +__git_complete_force_with_lease () +{ + local cur_=$1 + + case "$cur_" in + --*=) + ;; + *:*) + __gitcomp_nl "$(__git_refs)" "" "${cur_#*:}" + ;; + *) + __gitcomp_nl "$(__git_refs)" "" "$cur_" + ;; + esac +} + _git_push () { case "$prev" in @@ -1633,6 +1649,10 @@ _git_push () return esac case "$cur" in + --force-with-lease=*) + __git_complete_force_with_lease "${cur##--force-with-lease=}" + return + ;; --repo=*) __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}" return @@ -1646,7 +1666,7 @@ _git_push () --all --mirror --tags --dry-run --force --verbose --quiet --prune --delete --follow-tags --receive-pack= --repo= --set-upstream - --recurse-submodules= + --force-with-lease --force-with-lease= --recurse-submodules= " return ;; -- 2.0.1.472.g6f92e5f.dirty ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-22 18:24 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 2014-07-22 18:24 ` [PATCH v2 2/3] completion: add some missing options to `git push` John Keeping 2014-07-22 18:24 ` [PATCH v2 3/3] completion: complete `git push --force-with-lease=` John Keeping @ 2014-07-22 20:23 ` Junio C Hamano 2014-07-22 20:57 ` John Keeping 2 siblings, 1 reply; 18+ messages in thread From: Junio C Hamano @ 2014-07-22 20:23 UTC (permalink / raw) To: John Keeping; +Cc: git, Johannes Sixt John Keeping <john@keeping.me.uk> writes: > Since the argument to `--recurse-submodules` is mandatory, it does not > need to be stuck to the option with `=`. > > Signed-off-by: John Keeping <john@keeping.me.uk> > --- > Change since v1: > - Fix typo --recurse{_ => -}submodules > - Dropped previous patch 1/4 adding ";;" at the end of the "--repo" case > > contrib/completion/git-completion.bash | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 7a6e1d7..bed3665 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand" > _git_push () > { > case "$prev" in > + --recurse-submodules) > + __gitcomp "$__git_push_recurse_submodules" > + return > + ;; > --repo) > __gitcomp_nl "$(__git_remotes)" > return If you mimick the order they are handled in the case on "$cur", it would also let us sneak in the missing-optional ";;" to case/esac to keep symmetry between the two ;-) In other words, like this, perhaps? diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 019026e..b27f385 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1617,6 +1617,11 @@ _git_push () --repo) __gitcomp_nl "$(__git_remotes)" return + ;; + --recurse-submodules) + __gitcomp "$__git_push_recurse_submodules" + return + ;; esac case "$cur" in --repo=*) -- 2.0.2-892-g223db29 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-22 20:23 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` Junio C Hamano @ 2014-07-22 20:57 ` John Keeping 2014-07-22 21:17 ` Junio C Hamano 0 siblings, 1 reply; 18+ messages in thread From: John Keeping @ 2014-07-22 20:57 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Johannes Sixt On Tue, Jul 22, 2014 at 01:23:25PM -0700, Junio C Hamano wrote: > John Keeping <john@keeping.me.uk> writes: > > > Since the argument to `--recurse-submodules` is mandatory, it does not > > need to be stuck to the option with `=`. > > > > Signed-off-by: John Keeping <john@keeping.me.uk> > > --- > > Change since v1: > > - Fix typo --recurse{_ => -}submodules > > - Dropped previous patch 1/4 adding ";;" at the end of the "--repo" case > > > > contrib/completion/git-completion.bash | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > > index 7a6e1d7..bed3665 100644 > > --- a/contrib/completion/git-completion.bash > > +++ b/contrib/completion/git-completion.bash > > @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand" > > _git_push () > > { > > case "$prev" in > > + --recurse-submodules) > > + __gitcomp "$__git_push_recurse_submodules" > > + return > > + ;; > > --repo) > > __gitcomp_nl "$(__git_remotes)" > > return > > If you mimick the order they are handled in the case on "$cur", it > would also let us sneak in the missing-optional ";;" to case/esac to > keep symmetry between the two ;-) > > In other words, like this, perhaps? Makes sense. I don't think I noted the order in the "$cur" case, I just put the new one in here so that they were sorted lexicographically. Do you want me to re-roll with this change or can you replace the patch while applying? > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 019026e..b27f385 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1617,6 +1617,11 @@ _git_push () > --repo) > __gitcomp_nl "$(__git_remotes)" > return > + ;; > + --recurse-submodules) > + __gitcomp "$__git_push_recurse_submodules" > + return > + ;; > esac > case "$cur" in > --repo=*) > -- > 2.0.2-892-g223db29 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-22 20:57 ` John Keeping @ 2014-07-22 21:17 ` Junio C Hamano 2014-07-23 19:35 ` John Keeping 0 siblings, 1 reply; 18+ messages in thread From: Junio C Hamano @ 2014-07-22 21:17 UTC (permalink / raw) To: John Keeping; +Cc: git, Johannes Sixt John Keeping <john@keeping.me.uk> writes: > Makes sense. I don't think I noted the order in the "$cur" case, I just > put the new one in here so that they were sorted lexicographically. Unless there is particular reason, consistently using lexicographic order in all related places is one good way to organize things, but doing so would involve flipping orders in the other case statement for this particular patch. In general, I prefer to see people add new things at the end, when there is no particular reason to do otherwise. > Do you want me to re-roll with this change or can you replace the patch > while applying? I think I had to flip the third one to adjust to the change I suggested to this; the result will be on 'pu', so please double check when I push it out. Thanks. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-22 21:17 ` Junio C Hamano @ 2014-07-23 19:35 ` John Keeping 2014-07-23 21:31 ` Junio C Hamano 0 siblings, 1 reply; 18+ messages in thread From: John Keeping @ 2014-07-23 19:35 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Johannes Sixt On Tue, Jul 22, 2014 at 02:17:13PM -0700, Junio C Hamano wrote: > John Keeping <john@keeping.me.uk> writes: > > > Do you want me to re-roll with this change or can you replace the patch > > while applying? > > I think I had to flip the third one to adjust to the change I > suggested to this; the result will be on 'pu', so please double > check when I push it out. The result on jk/more-push-completion looks good. Thanks. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` 2014-07-23 19:35 ` John Keeping @ 2014-07-23 21:31 ` Junio C Hamano 0 siblings, 0 replies; 18+ messages in thread From: Junio C Hamano @ 2014-07-23 21:31 UTC (permalink / raw) To: John Keeping; +Cc: git, Johannes Sixt John Keeping <john@keeping.me.uk> writes: > On Tue, Jul 22, 2014 at 02:17:13PM -0700, Junio C Hamano wrote: >> John Keeping <john@keeping.me.uk> writes: >> >> > Do you want me to re-roll with this change or can you replace the patch >> > while applying? >> >> I think I had to flip the third one to adjust to the change I >> suggested to this; the result will be on 'pu', so please double >> check when I push it out. > > The result on jk/more-push-completion looks good. Thanks. Thanks. ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2014-07-23 21:31 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-07-19 9:45 [PATCH 1/4] completion: add missing terminator in case statement John Keeping 2014-07-19 9:45 ` [PATCH 2/4] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 2014-07-19 11:37 ` Johannes Sixt 2014-07-19 15:10 ` John Keeping 2014-07-19 9:45 ` [PATCH 3/4] completion: add some missing options to `git push` John Keeping 2014-07-19 9:45 ` [PATCH 4/4] completion: complete `git push --force-with-lease=` John Keeping 2014-07-21 17:26 ` [PATCH 1/4] completion: add missing terminator in case statement Junio C Hamano 2014-07-21 20:09 ` Junio C Hamano 2014-07-22 18:22 ` John Keeping 2014-07-22 20:18 ` Junio C Hamano 2014-07-22 18:24 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` John Keeping 2014-07-22 18:24 ` [PATCH v2 2/3] completion: add some missing options to `git push` John Keeping 2014-07-22 18:24 ` [PATCH v2 3/3] completion: complete `git push --force-with-lease=` John Keeping 2014-07-22 20:23 ` [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules` Junio C Hamano 2014-07-22 20:57 ` John Keeping 2014-07-22 21:17 ` Junio C Hamano 2014-07-23 19:35 ` John Keeping 2014-07-23 21:31 ` Junio C Hamano
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).