Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Zsh's git completion to Git's git completion instead #130

Open
gabebw opened this issue Jun 23, 2018 · 0 comments
Open

Switch from Zsh's git completion to Git's git completion instead #130

gabebw opened this issue Jun 23, 2018 · 0 comments
Labels

Comments

@gabebw
Copy link
Owner

gabebw commented Jun 23, 2018

Yeah yeah, #69 happened, but:

  • This is the big one: Zsh-based git completions don't include custom git subcommands. For example, I have a git-shalector script and git sha<TAB> doesn't work with Zsh's git completions, but does work with Git's.

  • The problem in Please help: why is gc autocompletion failing? #69 was that gc was broken. I now have a custom fuzzy-finder-backed gc that I love much more than tab-completion of git branches.

  • Both Zsh and Git complete git aliases like git full, though Zsh is a little better. I'm fine with using Git's version.

    • With Zsh, git <TAB> will show the aliases along with standard subcommands, and completes them as you'd expect:
    $ git <TAB>
     #...other output...
     unpack-objects     -- unpack objects from packed archive
     unstage            -- alias for 'reset HEAD'           
     up                 -- alias for '!git fetch origin && git rebase origin/master'
    
    • With Git, git <TAB> only shows the standard subcommands. However, if I start typing a custom alias and hit tab, like git fu<TAB>, then it autocompletes as you'd expect. I always know which alias I want to use, so I'm fine typing the first bit.

For debugging, here's how to switch between completions:

  • To switch to Zsh-based completion: brew uninstall --ignore-dependencies git && brew install git --without-completions, then open a new shell
  • To switch to Git-based completion: brew uninstall --ignore-dependencies git && brew install git, then open a new shell
@gabebw gabebw changed the title Switch back to git completion from git (not from Zsh) Switch from Zsh's git completion to Git's git completion instead Jun 23, 2018
@gabebw gabebw added the Zsh label Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant