FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix zsh completion instructions by jamiew · Pull Request #140 · git-friendly/git-friendly · GitHub

Fix zsh completion instructions - #140

Merged
jamiew merged 1 commit into
mainfrom
fix-zsh-completion-docs
Jul 13, 2026
Merged

Fix zsh completion instructions#140
jamiew merged 1 commit into
mainfrom
fix-zsh-completion-docs

Conversation

jamiew commented Jul 13, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

the zsh snippet in the README only works with zsh's built-in git completion — but Homebrew's git ships its own _git wrapper that shadows the built-in and never defines __git_branch_names, so branch <tab> fails for anyone with brew git.

also, $(brew --prefix)/share/zsh/functions doesn't exist unless zsh itself came from brew, and autoload -Uz _git && _git errors at shell startup.

so:

  • replace with a compdef _git_friendly branch=git-checkout approach that works with both the built-in completion and git's wrapper (verified by scripted tab-presses in both configs)
  • merge <tab> now completes too, matching the bash instructions

to test: add the new snippet to your .zshrc after compinit, rm -f ~/.zcompdump*; exec zsh, then branch <tab> in any repo

- old snippet only worked with zsh's built-in _git, which homebrew git's wrapper shadows; new compdef works with both
- drop nonexistent brew zsh functions path and the autoload trick that errors at startup
jamiew marked this pull request as ready for review July 13, 2026 18:05

jamiew commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator Author

this works well for me on mac, with homebrew, but zsh is the system zsh not homebrew zsh

jamiew merged commit 4ff9ee5 into main Jul 13, 2026
2 checks passed
jamiew deleted the fix-zsh-completion-docs branch July 13, 2026 18:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL