summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-07-09 00:19:50 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-07-09 00:19:50 -0700
commitbb293b831b9d0aade79c0acf5bf6091106e7d19b (patch)
tree6549f6423c83a66b04bf51daedcb5fa592170c27 /contrib/completion
parentDocumentation: update sections on naming revisions and revision ranges (diff)
parentStart preparing release notes for 1.5.6.3 (diff)
downloadtgif-bb293b831b9d0aade79c0acf5bf6091106e7d19b.tar.xz
Merge branch 'maint'
* maint: Start preparing release notes for 1.5.6.3 git-submodule - Fix bugs in adding an existing repo as a module bash: offer only paths after '--' Remove unnecessary pack-*.keep file after successful git-clone make deleting a missing ref more quiet
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash30
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index cc75ad7ccd..27332ed8b1 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -451,6 +451,18 @@ __git_find_subcommand ()
done
}
+__git_has_doubledash ()
+{
+ local c=1
+ while [ $c -lt $COMP_CWORD ]; do
+ if [ "--" = "${COMP_WORDS[c]}" ]; then
+ return 0
+ fi
+ c=$((++c))
+ done
+ return 1
+}
+
__git_whitespacelist="nowarn warn error error-all strip"
_git_am ()
@@ -497,6 +509,8 @@ _git_apply ()
_git_add ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -511,6 +525,8 @@ _git_add ()
_git_bisect ()
{
+ __git_has_doubledash && return
+
local subcommands="start bad good skip reset visualize replay log run"
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
@@ -613,6 +629,8 @@ _git_cherry_pick ()
_git_commit ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -632,6 +650,8 @@ _git_describe ()
_git_diff ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -734,6 +754,8 @@ _git_ls_tree ()
_git_log ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
@@ -1086,6 +1108,8 @@ _git_remote ()
_git_reset ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -1098,6 +1122,8 @@ _git_reset ()
_git_shortlog ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -1144,6 +1170,8 @@ _git_stash ()
_git_submodule ()
{
+ __git_has_doubledash && return
+
local subcommands="add status init update"
if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1350,6 +1378,8 @@ _git ()
_gitk ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
local g="$(git rev-parse --git-dir 2>/dev/null)"
local merge=""