X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Fcompletion%2Fgit-completion.bash;h=d3fb6ae5073c2b298eee37d566abf6a7cf834377;hb=b281eea75f0ab68e3c9510323c73b78cd3e62814;hp=7a7bc99955e9182be1fcd088932d49681a00dc35;hpb=b1bc1494edb1775e94a159dea67908b27c29017f;p=git.git diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 7a7bc9995..d3fb6ae50 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -271,15 +271,17 @@ __git_merge_strategies () echo "$__git_merge_strategylist" return fi - sed -n "/^all_strategies='/{ - s/^all_strategies='// - s/'// + git merge -s help 2>&1 | + sed -n -e '/[Aa]vailable strategies are: /,/^$/{ + s/\.$// + s/.*:// + s/^[ ]*// + s/[ ]*$// p - q - }" "$(git --exec-path)/git-merge" + }' } __git_merge_strategylist= -__git_merge_strategylist="$(__git_merge_strategies 2>/dev/null)" +__git_merge_strategylist=$(__git_merge_strategies 2>/dev/null) __git_complete_file () { @@ -384,7 +386,9 @@ __git_porcelain_commands () cat-file) : plumbing;; check-attr) : plumbing;; check-ref-format) : plumbing;; + checkout-index) : plumbing;; commit-tree) : plumbing;; + count-objects) : infrequent;; cvsexportcommit) : export;; cvsimport) : import;; cvsserver) : daemon;; @@ -393,6 +397,7 @@ __git_porcelain_commands () diff-index) : plumbing;; diff-tree) : plumbing;; fast-import) : import;; + fast-export) : export;; fsck-objects) : plumbing;; fetch-pack) : plumbing;; fmt-merge-msg) : plumbing;; @@ -402,6 +407,10 @@ __git_porcelain_commands () index-pack) : plumbing;; init-db) : deprecated;; local-fetch) : plumbing;; + lost-found) : infrequent;; + ls-files) : plumbing;; + ls-remote) : plumbing;; + ls-tree) : plumbing;; mailinfo) : plumbing;; mailsplit) : plumbing;; merge-*) : plumbing;; @@ -426,6 +435,7 @@ __git_porcelain_commands () runstatus) : plumbing;; sh-setup) : internal;; shell) : daemon;; + show-ref) : plumbing;; send-pack) : plumbing;; show-index) : plumbing;; ssh-*) : transport;; @@ -440,6 +450,8 @@ __git_porcelain_commands () upload-archive) : plumbing;; upload-pack) : plumbing;; write-tree) : plumbing;; + var) : infrequent;; + verify-pack) : infrequent;; verify-tag) : plumbing;; *) echo $i;; esac @@ -501,7 +513,7 @@ __git_has_doubledash () return 1 } -__git_whitespacelist="nowarn warn error error-all strip" +__git_whitespacelist="nowarn warn error error-all fix" _git_am () { @@ -769,7 +781,7 @@ _git_diff () __gitcomp "--cached --stat --numstat --shortstat --summary --patch-with-stat --name-only --name-status --color --no-color --color-words --no-renames --check - --full-index --binary --abbrev --diff-filter + --full-index --binary --abbrev --diff-filter= --find-copies-harder --pickaxe-all --pickaxe-regex --text --ignore-space-at-eol --ignore-space-change --ignore-all-space --exit-code --quiet --ext-diff @@ -885,7 +897,11 @@ _git_help () return ;; esac - __gitcomp "$(__git_all_commands)" + __gitcomp "$(__git_all_commands) + attributes cli core-tutorial cvs-migration + diffcore gitk glossary hooks ignore modules + repository-layout tutorial tutorial-2 + " } _git_init () @@ -972,6 +988,7 @@ _git_log () --decorate --diff-filter= --color-words --walk-reflogs --parents --children --full-history + --merge " return ;; @@ -1001,11 +1018,42 @@ _git_merge () __gitcomp "$(__git_refs)" } +_git_mergetool () +{ + local cur="${COMP_WORDS[COMP_CWORD]}" + case "$cur" in + --tool=*) + __gitcomp " + kdiff3 tkdiff meld xxdiff emerge + vimdiff gvimdiff ecmerge opendiff + " "" "${cur##--tool=}" + return + ;; + --*) + __gitcomp "--tool=" + return + ;; + esac + COMPREPLY=() +} + _git_merge_base () { __gitcomp "$(__git_refs)" } +_git_mv () +{ + local cur="${COMP_WORDS[COMP_CWORD]}" + case "$cur" in + --*) + __gitcomp "--dry-run" + return + ;; + esac + COMPREPLY=() +} + _git_name_rev () { __gitcomp "--tags --all --stdin" @@ -1427,7 +1475,7 @@ _git_stash () apply,--*) __gitcomp "--index" ;; - show,--*|apply,--*|drop,--*|pop,--*|branch,--*) + show,--*|drop,--*|pop,--*|branch,--*) COMPREPLY=() ;; show,*|apply,*|drop,*|pop,*|branch,*) @@ -1445,7 +1493,7 @@ _git_submodule () { __git_has_doubledash && return - local subcommands="add status init update" + local subcommands="add status init update summary foreach sync" if [ -z "$(__git_find_subcommand "$subcommands")" ]; then local cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in @@ -1638,7 +1686,9 @@ _git () ls-remote) _git_ls_remote ;; ls-tree) _git_ls_tree ;; merge) _git_merge;; + mergetool) _git_mergetool;; merge-base) _git_merge_base ;; + mv) _git_mv ;; name-rev) _git_name_rev ;; pull) _git_pull ;; push) _git_push ;;