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
When git and yadm are both installed via brew, the yadm bash-completion script clobbers the git completion #318
Comments
This same issue caused https://bugs.debian.org/980754 (bash completion stops working with the latest version of Git) for the same reason ( The following hack of a patch seems to make things work again, but it's kind of messy. I'm not sure if there's a better way.
|
@davidpfarrell Thanks for reporting these issues. @rra Thanks for the suggested solutions. I will likely do something close to that patch, utilizing _git when it exists, otherwise adopting the function _git was using. |
Incidentally, I only have the trouble of yadm completions being broken with the combination of brew installed yadm and git (3.0.2/2.30.0). Not and difference in how Git completions were defined. But I'm also not using BigSur, maybe that makes a difference. |
Git 2.30.0 removed an internal function yadm completion depended upon. This change retains the old function call for compatibility.
A fix for this problem has been pushed to branch |
Confirmed this works for me on Debian unstable. Thanks! |
Copied the file into my The main thing that finding the correct function name does for me is that it avoids the call to Are you sure that, in general (i.e outside of the brew git / brew yadm install), I'm just not sure if the bug is one of :
Anyway, as-is, the fix prevents my git completions from being clobbered - so thats great, thanks ! |
This change has been merged into the develop branch and will be part of the next release. |
* Use `git clone` directly during clone (#289, #323) * Fix compatibility bug with Git completions (#318, #321) * Support relative paths for --yadm-* and -w (#301) * Improve parsing of if-statement in default template (#303) * Read files without running cat in subshells (#317) * Improve portability of updating read-only files (#320) * Various code improvements (#306, #307, #311)
* Use `git clone` directly during clone (#289, #323) * Fix compatibility bug with Git completions (#318, #321) * Support relative paths for --yadm-* and -w (#301) * Improve parsing of if-statement in default template (#303) * Read files without running cat in subshells (#317) * Improve portability of updating read-only files (#320) * Various code improvements (#306, #307, #311)
Describe the bug
When git and yadm are both installed via brew, the yadm bash-completion script clobbers the git completion.
To reproduce
Can this be reproduced with the yadm/testbed docker image: [Yes/No]
Steps to reproduce the behavior:
Invoke bash completion when git is installed and yadm is not installed:
Invoke bash completion when both git and yadm are installed
Expected behavior
Expect git completion to be unchanged
Environment
Additional context
The following logic in the yadm bash completion script seems faulty:
When the
_git
function is not found, the invoked_completion_loader git
ends up clobbering the existing completion and replacing it with aminimal
completion.The official git bash completion script doesn't appear to create any functions named
_git
. It does, however, create__git
:I am not sure if this is the method it was intended to check for/call?
A couple of side notes:
sudo
and others have the ability to delegate to sub-command completions, so there may be some techniques there that could be used.The text was updated successfully, but these errors were encountered: