Add "--set-upstream" option to bash completion
PATCH 1/1 Add "--set-upstream" option to bash completion
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.
--- contrib/completion/git-completion.bash | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/completion/git-completion.bash +1 -1
@@ -1796,7 +1796,7 @@ _git_push () --*) __gitcomp " --all --mirror --tags --dry-run --force --verbose - --receive-pack= --repo= + --receive-pack= --repo= --set-upstream " return ;;
Signature · 1 line
1.7.5
Quoted 3 lines · 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.
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.
Quoted 19 lines
Signed-off-by Dmitry Medvinsky <[email protected]>--- contrib/completion/git-completion.bash | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)contrib/completion/git-completion.bash +1
-1@@ -1796,7 +1796,7 @@ _git_push () --*) __gitcomp " --all --mirror --tags --dry-run --force --verbose - --receive-pack= --repo= + --receive-pack= --repo= --set-upstream " return ;;