* [PATCH 0/2] Update BASH completions @ 2016-01-23 1:23 Paul Wagland 2016-01-23 1:25 ` PATCH 1/2] Update the flags for git show-branch Paul Wagland ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Paul Wagland @ 2016-01-23 1:23 UTC (permalink / raw) To: git While playing around git stash I noticed that some options were missing. I have updated these in the BASH completions file. Note that this is not a comprehensive review, but adds the options that I use in git-stash, and a nearby missing option. Paul Wagland (2): Update the flags for git show-branch Fix up the arguments for git stash. This adds the branch to the branch subcommand, and adds the missing options to save and drop commands contrib/completion/git-completion.bash | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) -- 2.7.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* PATCH 1/2] Update the flags for git show-branch 2016-01-23 1:23 [PATCH 0/2] Update BASH completions Paul Wagland @ 2016-01-23 1:25 ` Paul Wagland 2016-01-25 23:17 ` Junio C Hamano 2016-01-23 1:30 ` [PATCH 2/2] Fix up the arguments for git stash Paul Wagland 2016-01-26 9:34 ` [PATCH v2 0/2] Update BASH completions Paul Wagland 2 siblings, 1 reply; 10+ messages in thread From: Paul Wagland @ 2016-01-23 1:25 UTC (permalink / raw) To: git Signed-off-by: Paul Wagland <paul@kungfoocoder.org> --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index ab4da7f..63754bc 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2369,7 +2369,7 @@ _git_show_branch () case "$cur" in --*) __gitcomp " - --all --remotes --topo-order --current --more= + --all --remotes --topo-order --date-order --current --more= --list --independent --merge-base --no-name --color --no-color --sha1-name --sparse --topics --reflog -- 2.7.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: PATCH 1/2] Update the flags for git show-branch 2016-01-23 1:25 ` PATCH 1/2] Update the flags for git show-branch Paul Wagland @ 2016-01-25 23:17 ` Junio C Hamano 0 siblings, 0 replies; 10+ messages in thread From: Junio C Hamano @ 2016-01-25 23:17 UTC (permalink / raw) To: Paul Wagland; +Cc: git Thanks. I'll retitle this to completion: complete show-branch "--date-order" while queuing. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] Fix up the arguments for git stash. 2016-01-23 1:23 [PATCH 0/2] Update BASH completions Paul Wagland 2016-01-23 1:25 ` PATCH 1/2] Update the flags for git show-branch Paul Wagland @ 2016-01-23 1:30 ` Paul Wagland 2016-01-25 23:21 ` Junio C Hamano 2016-01-26 9:34 ` [PATCH v2 0/2] Update BASH completions Paul Wagland 2 siblings, 1 reply; 10+ messages in thread From: Paul Wagland @ 2016-01-23 1:30 UTC (permalink / raw) To: git Signed-off-by: Paul Wagland <paul@kungfoocoder.org> --- contrib/completion/git-completion.bash | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 63754bc..043d5bb 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2382,7 +2382,7 @@ _git_show_branch () _git_stash () { - local save_opts='--keep-index --no-keep-index --quiet --patch' + local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' local subcommands='save list show apply clear drop pop create branch' local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then @@ -2404,9 +2404,20 @@ _git_stash () apply,--*|pop,--*) __gitcomp "--index --quiet" ;; - show,--*|drop,--*|branch,--*) + drop,--*) + __gitcomp "--quiet" ;; - show,*|apply,*|drop,*|pop,*|branch,*) + show,--*|branch,--*) + ;; + branch,*) + if [ $cword -eq 3 ]; then + __gitcomp_nl "$(__git_refs)"; + else + __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ + | sed -n -e 's/:.*//p')" + fi + ;; + show,*|apply,*|drop,*|pop,*) __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ | sed -n -e 's/:.*//p')" ;; -- 2.7.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] Fix up the arguments for git stash. 2016-01-23 1:30 ` [PATCH 2/2] Fix up the arguments for git stash Paul Wagland @ 2016-01-25 23:21 ` Junio C Hamano 2016-01-26 6:21 ` Paul Wagland 0 siblings, 1 reply; 10+ messages in thread From: Junio C Hamano @ 2016-01-25 23:21 UTC (permalink / raw) To: Paul Wagland; +Cc: git Paul Wagland <paul@kungfoocoder.org> writes: > Signed-off-by: Paul Wagland <paul@kungfoocoder.org> > --- This needs a better explanation than just "Fix up" in the title. What is broken in the current behaviour and what is the more desired behaviour? Thanks. > contrib/completion/git-completion.bash | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 63754bc..043d5bb 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -2382,7 +2382,7 @@ _git_show_branch () > > _git_stash () > { > - local save_opts='--keep-index --no-keep-index --quiet --patch' > + local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' > local subcommands='save list show apply clear drop pop create branch' > local subcommand="$(__git_find_on_cmdline "$subcommands")" > if [ -z "$subcommand" ]; then > @@ -2404,9 +2404,20 @@ _git_stash () > apply,--*|pop,--*) > __gitcomp "--index --quiet" > ;; > - show,--*|drop,--*|branch,--*) > + drop,--*) > + __gitcomp "--quiet" > ;; > - show,*|apply,*|drop,*|pop,*|branch,*) > + show,--*|branch,--*) > + ;; > + branch,*) > + if [ $cword -eq 3 ]; then > + __gitcomp_nl "$(__git_refs)"; > + else > + __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ > + | sed -n -e 's/:.*//p')" > + fi > + ;; > + show,*|apply,*|drop,*|pop,*) > __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ > | sed -n -e 's/:.*//p')" > ;; ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] Fix up the arguments for git stash. 2016-01-25 23:21 ` Junio C Hamano @ 2016-01-26 6:21 ` Paul Wagland 0 siblings, 0 replies; 10+ messages in thread From: Paul Wagland @ 2016-01-26 6:21 UTC (permalink / raw) To: Junio C Hamano; +Cc: git Fair enough. I'll re-roll the patches with improved comments, and get these out to the list today. Cheers, Paul Sent from my iPhone > On 26 Jan 2016, at 00:21, Junio C Hamano <gitster@pobox.com> wrote: > > Paul Wagland <paul@kungfoocoder.org> writes: > >> Signed-off-by: Paul Wagland <paul@kungfoocoder.org> >> --- > > This needs a better explanation than just "Fix up" in the title. > What is broken in the current behaviour and what is the more desired > behaviour? > > Thanks. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 0/2] Update BASH completions 2016-01-23 1:23 [PATCH 0/2] Update BASH completions Paul Wagland 2016-01-23 1:25 ` PATCH 1/2] Update the flags for git show-branch Paul Wagland 2016-01-23 1:30 ` [PATCH 2/2] Fix up the arguments for git stash Paul Wagland @ 2016-01-26 9:34 ` Paul Wagland 2016-01-26 9:36 ` [PATCH v2 1/2] completion: complete show-branch "--date-order" Paul Wagland 2016-01-26 9:37 ` [PATCH v2 2/4] completion: update completion arguments for stash Paul Wagland 2 siblings, 2 replies; 10+ messages in thread From: Paul Wagland @ 2016-01-26 9:34 UTC (permalink / raw) To: git; +Cc: Junio C Hamano While playing around git stash I noticed that some options were missing. I have updated these in the BASH completions file. Note that this is not a comprehensive review, but adds the options that I use in git-stash, and a nearby missing option. This re-roll doesn't change the code, but updates the commit comments to make it clearer what each change is doing. Paul Wagland (2): Update the flags for git show-branch Fix up the arguments for git stash. This adds the branch to the branch subcommand, and adds the missing options to save and drop commands contrib/completion/git-completion.bash | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) -- 2.7.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/2] completion: complete show-branch "--date-order" 2016-01-26 9:34 ` [PATCH v2 0/2] Update BASH completions Paul Wagland @ 2016-01-26 9:36 ` Paul Wagland 2016-01-26 9:37 ` [PATCH v2 2/4] completion: update completion arguments for stash Paul Wagland 1 sibling, 0 replies; 10+ messages in thread From: Paul Wagland @ 2016-01-26 9:36 UTC (permalink / raw) To: git; +Cc: Junio C Hamano Signed-off-by: Paul Wagland <paul@kungfoocoder.org> --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index ab4da7f..63754bc 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2369,7 +2369,7 @@ _git_show_branch () case "$cur" in --*) __gitcomp " - --all --remotes --topo-order --current --more= + --all --remotes --topo-order --date-order --current --more= --list --independent --merge-base --no-name --color --no-color --sha1-name --sparse --topics --reflog -- 2.7.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/4] completion: update completion arguments for stash 2016-01-26 9:34 ` [PATCH v2 0/2] Update BASH completions Paul Wagland 2016-01-26 9:36 ` [PATCH v2 1/2] completion: complete show-branch "--date-order" Paul Wagland @ 2016-01-26 9:37 ` Paul Wagland 2016-02-22 13:02 ` [PATCH] completion: fix mis-indentation in _git_stash() SZEDER Gábor 1 sibling, 1 reply; 10+ messages in thread From: Paul Wagland @ 2016-01-26 9:37 UTC (permalink / raw) To: git; +Cc: Junio C Hamano Add --all and --include-untracked to the git stash save completions. Add --quiet to the git stash drop completions. Update git stash branch so that the first argument expands out to the possible branch names, and the other arguments expand to the stash names. Signed-off-by: Paul Wagland <paul@kungfoocoder.org> --- contrib/completion/git-completion.bash | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 63754bc..043d5bb 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2382,7 +2382,7 @@ _git_show_branch () _git_stash () { - local save_opts='--keep-index --no-keep-index --quiet --patch' + local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' local subcommands='save list show apply clear drop pop create branch' local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then @@ -2404,9 +2404,20 @@ _git_stash () apply,--*|pop,--*) __gitcomp "--index --quiet" ;; - show,--*|drop,--*|branch,--*) + drop,--*) + __gitcomp "--quiet" ;; - show,*|apply,*|drop,*|pop,*|branch,*) + show,--*|branch,--*) + ;; + branch,*) + if [ $cword -eq 3 ]; then + __gitcomp_nl "$(__git_refs)"; + else + __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ + | sed -n -e 's/:.*//p')" + fi + ;; + show,*|apply,*|drop,*|pop,*) __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ | sed -n -e 's/:.*//p')" ;; -- 2.7.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] completion: fix mis-indentation in _git_stash() 2016-01-26 9:37 ` [PATCH v2 2/4] completion: update completion arguments for stash Paul Wagland @ 2016-02-22 13:02 ` SZEDER Gábor 0 siblings, 0 replies; 10+ messages in thread From: SZEDER Gábor @ 2016-02-22 13:02 UTC (permalink / raw) To: Junio C Hamano; +Cc: Paul Wagland, git, SZEDER Gábor Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 45ec47f2b1b4..e3918c87e3ad 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2415,8 +2415,8 @@ _git_stash () show,--*|branch,--*) ;; branch,*) - if [ $cword -eq 3 ]; then - __gitcomp_nl "$(__git_refs)"; + if [ $cword -eq 3 ]; then + __gitcomp_nl "$(__git_refs)"; else __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ | sed -n -e 's/:.*//p')" -- 2.7.1.384.g61d9461 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-02-22 13:03 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-01-23 1:23 [PATCH 0/2] Update BASH completions Paul Wagland 2016-01-23 1:25 ` PATCH 1/2] Update the flags for git show-branch Paul Wagland 2016-01-25 23:17 ` Junio C Hamano 2016-01-23 1:30 ` [PATCH 2/2] Fix up the arguments for git stash Paul Wagland 2016-01-25 23:21 ` Junio C Hamano 2016-01-26 6:21 ` Paul Wagland 2016-01-26 9:34 ` [PATCH v2 0/2] Update BASH completions Paul Wagland 2016-01-26 9:36 ` [PATCH v2 1/2] completion: complete show-branch "--date-order" Paul Wagland 2016-01-26 9:37 ` [PATCH v2 2/4] completion: update completion arguments for stash Paul Wagland 2016-02-22 13:02 ` [PATCH] completion: fix mis-indentation in _git_stash() SZEDER Gábor
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).