From: Junio C Hamano Date: Sun, 17 May 2009 06:08:49 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.6.4-rc0~164 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/55524fcf9d6676ca3840227092bf3a14ba404615?hp=-c Merge branch 'maint' * maint: completion: add missing options to show-branch and show dir.c: clean up handling of 'path' parameter in read_directory_recursive() Fix type-punning issues --- 55524fcf9d6676ca3840227092bf3a14ba404615 diff --combined contrib/completion/git-completion.bash index b6bcd5cc26,a0c5794828..f8d4cb2c7d --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -1334,35 -1334,6 +1334,35 @@@ _git_send_email ( COMPREPLY=() } +__git_config_get_set_variables () +{ + local prevword word config_file= c=$COMP_CWORD + while [ $c -gt 1 ]; do + word="${COMP_WORDS[c]}" + case "$word" in + --global|--system|--file=*) + config_file="$word" + break + ;; + -f|--file) + config_file="$word $prevword" + break + ;; + esac + prevword=$word + c=$((--c)) + done + + for i in $(git --git-dir="$(__gitdir)" config $config_file --list \ + 2>/dev/null); do + case "$i" in + *.*) + echo "${i/=*/}" + ;; + esac + done +} + _git_config () { local cur="${COMP_WORDS[COMP_CWORD]}" @@@ -1429,10 -1400,6 +1429,10 @@@ __gitcomp "$__git_send_email_suppresscc_options" return ;; + --get|--get-all|--unset|--unset-all) + __gitcomp "$(__git_config_get_set_variables)" + return + ;; *.*) COMPREPLY=() return @@@ -1837,7 -1804,7 +1837,7 @@@ _git_show ( return ;; --*) - __gitcomp "--pretty= --format= + __gitcomp "--pretty= --format= --abbrev-commit --oneline $__git_diff_common_options " return @@@ -1854,7 -1821,7 +1854,7 @@@ _git_show_branch ( __gitcomp " --all --remotes --topo-order --current --more= --list --independent --merge-base --no-name - --sha1-name --topics --reflog + --sha1-name --sparse --topics --reflog " return ;;