summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a79347)
raw | patch | inline | side by side (parent: 3a79347)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 15 Dec 2006 07:20:03 +0000 (02:20 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 16 Dec 2006 06:31:01 +0000 (22:31 -0800) |
Now that 'git show' accepts ref:path as an argument to specify a
tree or blob we should use the same completion logic as we support
for cat-file's object identifier.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
tree or blob we should use the same completion logic as we support
for cat-file's object identifier.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/completion/git-completion.bash | patch | blob | history |
index 9c4d23a23c899798613978c1766d08a80ced6f2e..234cd0954b888d814d8d4d86bb41983b80fddade 100755 (executable)
COMPREPLY=($(compgen -W "$opt $(__git_refs)" -- "$cur"))
}
+_git_show ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --pretty=*)
+ COMPREPLY=($(compgen -W "
+ oneline short medium full fuller email raw
+ " -- "${cur##--pretty=}"))
+ return
+ ;;
+ --*)
+ COMPREPLY=($(compgen -W "--pretty=" -- "$cur"))
+ return
+ ;;
+ esac
+ __git_complete_file
+}
+
_git ()
{
local i c=1 command __git_dir
rebase) _git_rebase ;;
repo-config) _git_repo_config ;;
reset) _git_reset ;;
- show) _git_log ;;
+ show) _git_show ;;
show-branch) _git_log ;;
whatchanged) _git_log ;;
*) COMPREPLY=() ;;
complete -o default -F _git_rebase git-rebase
complete -o default -F _git_repo_config git-repo-config
complete -o default -F _git_reset git-reset
-complete -o default -F _git_log git-show
+complete -o default -o nospace -F _git_show git-show
complete -o default -o nospace -F _git_log git-show-branch
complete -o default -o nospace -F _git_log git-whatchanged
complete -o default -F _git_name_rev git-name-rev.exe
complete -o default -o nospace -F _git_push git-push.exe
complete -o default -F _git_repo_config git-repo-config
-complete -o default -o nospace -F _git_log git-show.exe
+complete -o default -o nospace -F _git_show git-show.exe
complete -o default -o nospace -F _git_log git-show-branch.exe
complete -o default -o nospace -F _git_log git-whatchanged.exe
fi