git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add "--set-upstream" option to bash completion
@ 2011-04-29 15:57 Dmitry Medvinsky
  2011-04-29 16:31 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Medvinsky @ 2011-04-29 15:57 UTC (permalink / raw)
  To: git, gitster; +Cc: Dmitry Medvinsky

Since version 1.7.5 there is a new help message when pushing a branch with no
upstream telling about the ability to use "--set-upstream" option. That option
should be tab-completed for git push command.

Signed-off-by: Dmitry Medvinsky <dmedvinsky@gmail.com>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9150ea6..cc90e43 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1796,7 +1796,7 @@ _git_push ()
 	--*)
 		__gitcomp "
 			--all --mirror --tags --dry-run --force --verbose
-			--receive-pack= --repo=
+			--receive-pack= --repo= --set-upstream
 		"
 		return
 		;;
-- 
1.7.5

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

* Re: [PATCH] Add "--set-upstream" option to bash completion
  2011-04-29 15:57 [PATCH] Add "--set-upstream" option to bash completion Dmitry Medvinsky
@ 2011-04-29 16:31 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2011-04-29 16:31 UTC (permalink / raw)
  To: Dmitry Medvinsky; +Cc: git

Dmitry Medvinsky <dmedvinsky@gmail.com> writes:

> Since version 1.7.5 there is a new help message when pushing a branch with no
> upstream telling about the ability to use "--set-upstream" option. That option
> should be tab-completed for git push command.

Unless you are on a branch that does not have "upstream" defined for, the
option is useless, isn't it?  If that is the case, it should not be shown.

Can you make this conditional without too much overhead?  Is it worth
doing?

I suspect that offering this completion unconditionally hurts more than it
helps users, as it would be much less common for users to be using this
option than this option being no-op (or it could error out---I didn't
check).  After all, you give this option just once and then after that
keep running "git push" without it.

>
> Signed-off-by: Dmitry Medvinsky <dmedvinsky@gmail.com>
> ---
>  contrib/completion/git-completion.bash |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 9150ea6..cc90e43 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1796,7 +1796,7 @@ _git_push ()
>  	--*)
>  		__gitcomp "
>  			--all --mirror --tags --dry-run --force --verbose
> -			--receive-pack= --repo=
> +			--receive-pack= --repo= --set-upstream
>  		"
>  		return
>  		;;

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

end of thread, other threads:[~2011-04-29 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-29 15:57 [PATCH] Add "--set-upstream" option to bash completion Dmitry Medvinsky
2011-04-29 16: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).