All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bash completion: allow git stash store options completion
@ 2015-01-13 17:53 Alexander Kuleshov
  2015-01-13 18:40 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kuleshov @ 2015-01-13 17:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Alexander Kuleshov

This patch adds bash completion for git stash 'store' subcommand
which apperead at bd514cad (stash: introduce 'git stash store', 18 Jun 2013)

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 contrib/completion/git-completion.bash | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c21190d..7578266 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2375,7 +2375,7 @@ _git_show_branch ()
 _git_stash ()
 {
 	local save_opts='--keep-index --no-keep-index --quiet --patch'
-	local subcommands='save list show apply clear drop pop create branch'
+	local subcommands='save list show apply clear drop pop create branch store'
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
 		case "$cur" in
@@ -2402,6 +2402,9 @@ _git_stash ()
 			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
 					| sed -n -e 's/:.*//p')"
 			;;
+		store,--*)
+			__gitcomp "--message --quiet"
+			;;
 		*)
 			;;
 		esac
-- 
2.3.0.rc0.239.g0ae1f56.dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] bash completion: allow git stash store options completion
  2015-01-13 17:53 [PATCH] bash completion: allow git stash store options completion Alexander Kuleshov
@ 2015-01-13 18:40 ` Junio C Hamano
  2015-01-14 19:03   ` brian m. carlson
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2015-01-13 18:40 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: git

Alexander Kuleshov <kuleshovmail@gmail.com> writes:

> This patch adds bash completion for git stash 'store' subcommand
> which apperead at bd514cad (stash: introduce 'git stash store', 18 Jun 2013)
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---

Hmph.  The "create" and "store" subcommands are not end-user facing;
they are meant to be used in scripts.  I am not sure if we want to
complete them in the first place.  I know "create" already is in the
list of completion candidates, but I wonder if adding "store" is
making things worse.

I dunno.

>  contrib/completion/git-completion.bash | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index c21190d..7578266 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -2375,7 +2375,7 @@ _git_show_branch ()
>  _git_stash ()
>  {
>  	local save_opts='--keep-index --no-keep-index --quiet --patch'
> -	local subcommands='save list show apply clear drop pop create branch'
> +	local subcommands='save list show apply clear drop pop create branch store'
>  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
>  	if [ -z "$subcommand" ]; then
>  		case "$cur" in
> @@ -2402,6 +2402,9 @@ _git_stash ()
>  			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
>  					| sed -n -e 's/:.*//p')"
>  			;;
> +		store,--*)
> +			__gitcomp "--message --quiet"
> +			;;
>  		*)
>  			;;
>  		esac

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bash completion: allow git stash store options completion
  2015-01-13 18:40 ` Junio C Hamano
@ 2015-01-14 19:03   ` brian m. carlson
  2015-01-14 20:06     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: brian m. carlson @ 2015-01-14 19:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alexander Kuleshov, git

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

On Tue, Jan 13, 2015 at 10:40:40AM -0800, Junio C Hamano wrote:
>Alexander Kuleshov <kuleshovmail@gmail.com> writes:
>
>> This patch adds bash completion for git stash 'store' subcommand
>> which apperead at bd514cad (stash: introduce 'git stash store', 18 Jun 2013)
>>
>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
>> ---
>
>Hmph.  The "create" and "store" subcommands are not end-user facing;
>they are meant to be used in scripts.  I am not sure if we want to
>complete them in the first place.  I know "create" already is in the
>list of completion candidates, but I wonder if adding "store" is
>making things worse.

For what it's worth, I'll often sketch out a script at the command line 
before putting it in a file (either because I realize I'll need to do 
the same thing again or I want to share it with others), so I think this 
might be a useful addition.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bash completion: allow git stash store options completion
  2015-01-14 19:03   ` brian m. carlson
@ 2015-01-14 20:06     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2015-01-14 20:06 UTC (permalink / raw)
  To: brian m. carlson; +Cc: Alexander Kuleshov, git


"brian m. carlson" <sandals@crustytoothpaste.net> writes:

[administrivia: please refrain from using Mail-follow-up-to]

> For what it's worth, I'll often sketch out a script at the command
> line before putting it in a file (either because I realize I'll need
> to do the same thing again or I want to share it with others), so I
> think this might be a useful addition.

Yes, but that applies to manual pages and possibly "-h" short hint;
keeping completion that is unnecessary for end-users has cost, e.g.
making unique prefix longer.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-14 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-13 17:53 [PATCH] bash completion: allow git stash store options completion Alexander Kuleshov
2015-01-13 18:40 ` Junio C Hamano
2015-01-14 19:03   ` brian m. carlson
2015-01-14 20:06     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.