From: Junio C Hamano Date: Fri, 8 Feb 2013 23:28:42 +0000 (-0800) Subject: Merge branch 'mp/complete-paths' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d931e2fb252ed2dc4ecdbc24683000da1ec8e989;p=git.git Merge branch 'mp/complete-paths' The completion script used to let the default completer to suggest pathnames, which gave too many irrelevant choices (e.g. "git add" would not want to add an unmodified path). Teach it to use a more git-aware logic to enumerate only relevant ones. * mp/complete-paths: git-completion.bash: add support for path completion --- d931e2fb252ed2dc4ecdbc24683000da1ec8e989 diff --cc contrib/completion/git-completion.bash index 5770b6f2d,51b8b3b5b..c8452fb16 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -979,15 -1159,13 +1169,20 @@@ _git_clone ( _git_commit () { - __git_has_doubledash && return + case "$prev" in + -c|-C) + __gitcomp_nl "$(__git_refs)" "" "${cur}" + return + ;; + esac + case "$prev" in + -c|-C) + __gitcomp_nl "$(__git_refs)" "" "${cur}" + return + ;; + esac + case "$cur" in --cleanup=*) __gitcomp "default strip verbatim whitespace