{"thread":{"id":"27221","subject":"[PATCH] Add \"--set-upstream\" option to bash completion","startedAt":"2011-04-29T15:57:01Z","lastAt":"2011-04-29T16:31:14Z","messageCount":2,"participants":["Dmitry Medvinsky","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166741","messageId":"1304092621-554-1-git-send-email-dmedvinsky@gmail.com","threadId":"27221","inReplyTo":null,"subject":"[PATCH] Add \"--set-upstream\" option to bash completion","fromName":"Dmitry Medvinsky","fromEmail":"dmedvinsky@gmail.com","sentAt":"2011-04-29T15:57:01Z","receivedAt":"2011-04-29T15:57:01Z","isPatch":true,"sender":{"key":"dmedvinsky@gmail.com","avatar":null},"body":"Since version 1.7.5 there is a new help message when pushing a branch with no\nupstream telling about the ability to use \"--set-upstream\" option. That option\nshould be tab-completed for git push command.\n\nSigned-off-by: Dmitry Medvinsky <dmedvinsky@gmail.com>\n---\n contrib/completion/git-completion.bash |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9150ea6..cc90e43 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1796,7 +1796,7 @@ _git_push ()\n \t--*)\n \t\t__gitcomp \"\n \t\t\t--all --mirror --tags --dry-run --force --verbose\n-\t\t\t--receive-pack= --repo=\n+\t\t\t--receive-pack= --repo= --set-upstream\n \t\t\"\n \t\treturn\n \t\t;;\n-- \n1.7.5\n"},{"id":"166750","messageId":"7vbozpxbn1.fsf@alter.siamese.dyndns.org","threadId":"27221","inReplyTo":"1304092621-554-1-git-send-email-dmedvinsky@gmail.com","subject":"Re: [PATCH] Add \"--set-upstream\" option to bash completion","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-29T16:31:14Z","receivedAt":"2011-04-29T16:31:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dmitry Medvinsky <dmedvinsky@gmail.com> writes:\n\n> Since version 1.7.5 there is a new help message when pushing a branch with no\n> upstream telling about the ability to use \"--set-upstream\" option. That option\n> should be tab-completed for git push command.\n\nUnless you are on a branch that does not have \"upstream\" defined for, the\noption is useless, isn't it?  If that is the case, it should not be shown.\n\nCan you make this conditional without too much overhead?  Is it worth\ndoing?\n\nI suspect that offering this completion unconditionally hurts more than it\nhelps users, as it would be much less common for users to be using this\noption than this option being no-op (or it could error out---I didn't\ncheck).  After all, you give this option just once and then after that\nkeep running \"git push\" without it.\n\n>\n> Signed-off-by: Dmitry Medvinsky <dmedvinsky@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 9150ea6..cc90e43 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1796,7 +1796,7 @@ _git_push ()\n>  \t--*)\n>  \t\t__gitcomp \"\n>  \t\t\t--all --mirror --tags --dry-run --force --verbose\n> -\t\t\t--receive-pack= --repo=\n> +\t\t\t--receive-pack= --repo= --set-upstream\n>  \t\t\"\n>  \t\treturn\n>  \t\t;;\n"}]}