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

Handle undefined __git_complete #1055

Merged
merged 3 commits into from
Dec 13, 2020
Merged

Handle undefined __git_complete #1055

merged 3 commits into from
Dec 13, 2020

Conversation

darcyparker
Copy link
Contributor

Addresses #1011

As identified in #1011 (comment), there are cases where __git_complete is undefined because it is loaded dynamically by bash_completions.

As suggested in #1011 (comment), using pkg-config to find git-completion script, which defines __git_complete. And using approach similar to https://github.com/felipec/git-completion/blob/master/git-completion.zsh#L28-L49

Addresses jonas#1011

As identified in jonas#1011 (comment), there are cases where `__git_complete` is undefined because it is loaded dynamically by bash_completions.

As suggested in jonas#1011 (comment), using `pkg-config` to find `git-completion` script, which defines `__git_complete`.  And using approach similar to https://github.com/felipec/git-completion/blob/master/git-completion.zsh#L28-L49
#tig-completion requires __git_complete
#* If not defined, source git completions script so __git_complete is available
if ! declare -f __git_complete &>/dev/null; then
_bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) ||
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: the indentation should be consistent with the rest of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I will fix that.

@rohieb
Copy link

rohieb commented Dec 9, 2020

Yep, LGTM now.

@koutcher
Copy link
Collaborator

Thanks.

@koutcher koutcher merged commit 9d7b5cd into jonas:master Dec 13, 2020
@darcyparker darcyparker deleted the patch-1 branch December 13, 2020 17:27
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.

3 participants