Merge branch 'sg/completion-refs-speedup'
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 Mar 2017 21:07:14 +0000 (14:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Mar 2017 21:07:14 +0000 (14:07 -0700)
The refs completion for large number of refs has been sped up,
partly by giving up disambiguating ambiguous refs and partly by
eliminating most of the shell processing between 'git for-each-ref'
and 'ls-remote' and Bash's completion facility.

* sg/completion-refs-speedup:
completion: speed up branch and tag completion
completion: fill COMPREPLY directly when completing fetch refspecs
completion: fill COMPREPLY directly when completing refs
completion: let 'for-each-ref' sort remote branches for 'checkout' DWIMery
completion: let 'for-each-ref' filter remote branches for 'checkout' DWIMery
completion: let 'for-each-ref' strip the remote name from remote branches
completion: let 'for-each-ref' and 'ls-remote' filter matching refs
completion: don't disambiguate short refs
completion: don't disambiguate tags and branches
completion: support excluding full refs
completion: support completing fully qualified non-fast-forward refspecs
completion: support completing full refs after '--option=refs/<TAB>'
completion: wrap __git_refs() for better option parsing
completion: remove redundant __gitcomp_nl() options from _git_commit()

1  2 
contrib/completion/git-completion.bash
index fc32286a43cdece9ea468c4a07c2a8e3d585f1b5,bd07d9a7461021be6ab58b5083c34169e455f965..380f755b9fd0a049d5edf5f54210aac39ab48d3e
@@@ -2510,26 -2561,9 +2611,26 @@@ _git_remote (
  
  _git_replace ()
  {
-       __gitcomp_nl "$(__git_refs)"
 +      case "$cur" in
 +      --*)
 +              __gitcomp "--edit --graft --format= --list --delete"
 +              return
 +              ;;
 +      esac
+       __git_complete_refs
  }
  
 +_git_rerere ()
 +{
 +      local subcommands="clear forget diff remaining status gc"
 +      local subcommand="$(__git_find_on_cmdline "$subcommands")"
 +      if test -z "$subcommand"
 +      then
 +              __gitcomp "$subcommands"
 +              return
 +      fi
 +}
 +
  _git_reset ()
  {
        __git_has_doubledash && return