Whenever I press tab after entering git stash drop
, I get the following error message (outputted thrice in a row):
_arguments:comparguments:325: invalid argument: _git-notes
_git-stash:88: command not found: (-q --quiet)-q[suppress all output]
The actual stash deletion still does work, but it's a hassle to have to list my stashes first before choosing.
I've tried uninstalling and reinstalling git, but to no avail.
If it helps, I upgraded recently to Ubuntu 20.04 from 19.10 and I don't recall this bug ever appearing in the previous OS version.
I found a temporary solution (until Ubuntu gets a later version of zsh with the fix) here:
https://github.com/ohmyzsh/ohmyzsh/issues/9264
This github issue references the zsh commit which fixes it: https://github.com/zsh-users/zsh/commit/754658aff38e1bdf487c58bec6174cbecd019d11
So - taken from those places you can do this to fix it:
ls -l ${^fpath}/_git(N)
vim /usr/share/zsh/functions/Completion/Unix/_git
_arguments -S $endopt \_git-notes
to _arguments -S $endopt \
The gstd
command should now work fine without receiving errors. I did this a few months ago and it's been fine ever since. Had to do it on another machine which is why I ended up looking for this solution again. Thought I'd post here to help myself (and everyone else) for the future!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With