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

Error returnned when attempting to autocomplete git commands while not in a git repository #3013

Closed
nanenj opened this issue Aug 10, 2014 · 2 comments · Fixed by #3651
Closed

Comments

@nanenj
Copy link

nanenj commented Aug 10, 2014

Typing: git checkout [TAB] while not inside of a git repository results in the following:

[nanenj]% git checkout fatal: Not a git repository (or any of the parent directories): .git
HEAD

When not in a git repositiory, it should fail to autocomplete and should not suggest HEAD. The failure to autocomplete is indication enough that it's not working and as is the error returned while hitting tab destroys the prompt and makes things difficult to read.

I don't think tab completion should be returning errors. It should either default to how zsh itself behaves or just not autocomplete at all. Even if this isn't an 'issue' that will get resolved. If someone could point me in the right direction of where to look so I could at least fix it to my tastes locally, that'd be awesome.

Currently I've explored large portions of the git.zsh functions in lib, and the git plugin, but, most if not all of the obvious calls in both of these places redirect stderr to /dev/null, indicating that the behavior I'm after is actually what's intended.

@nanenj
Copy link
Author

nanenj commented Aug 10, 2014

After a small bit of searching all the other issues related to git, I found this comment. #2394 (comment) which advises to run

brew uninstall --force git && brew install git --without-completions

This appears to resolve the issue. I'm not certain if doing this means I'm missing out on a good deal of git completion functionality or not. I suppose if I don't know, I won't miss it :)

@mcornella
Copy link
Member

Can you close?

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 a pull request may close this issue.

2 participants