Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-06-23 02:44:04 +0400
committerShawn O. Pearce <spearce@spearce.org>2007-06-23 02:44:04 +0400
commit92d7c8e37b96244f2c55f5c66ec52c6325acca1d (patch)
treeffdea083b5693b35a5fd25c0bd992c1b714c2cea /contrib/completion
parent45fd8bd32dd68ce6b14a406d0abbd6f56490131c (diff)
Avoid src:dst syntax as default bash completion for git push
Raimund Bauer just discovered that the default bash completion for a local branch name in a git-push line is not the best choice when the branch does not exist on the remote system. In the past we have always completed the local name 'test' as "test:test", indicating that the destination name is the same as the local name. But this fails when "test" does not yet exist on the remote system, as there is no "test" branch for it to match the name against. Fortunately git-push does the right thing when given just the local branch, as it assumes you want to use the same name in the destination repository. So we now offer "test" as the completion in a git-push line, and let git-push assume that is also the remote branch name. We also still support the remote branch completion after the :, but only if the user manually adds the colon before trying to get a completion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9e72f0f7b1..c7c9963347 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -683,7 +683,7 @@ _git_push ()
__gitcomp "$(__git_refs "$remote")" "" "${cur#*:}"
;;
*)
- __gitcomp "$(__git_refs2)"
+ __gitcomp "$(__git_refs)"
;;
esac
;;