Hello,
I don't know if this has come up before (I didn't notice in a casual grep of git log), but attached is a little patch to wrap the bash completion script in a `type git' check.
From the patch header:
--
The onus for checking if a command exists before loading its completions
properly falls on individual completion files since they are normally
sourced from a completions directory (e.g. source /etc/bash_completion.d/*),
or perhaps from a single file concatenated from other completion files.
Also, this is standard practice with other bash-completion scripts.
--
Cheers,
Sung Pae
From: Shawn O. Pearce <hidden> Date: 2016-06-15 22:47:56
Nanako Shiraishi [off-list ref] wrote:
Junio, could you tell us what happened to this thread?
The patch avoids failing completion script when git is not there.
No discussion.
Actually, that's probably my fault. I never sent an ack or nak,
or anything else really, on this thread.
Originally this was because the completion was trying to run git
as it loaded. In 1.6.6 this is no longer true, the completion list
is generated lazily on demand during the first completion attempt.
With the lazy loading, I didn't see a reason to add this ugly block
around the entire script.
--
Shawn.
From: Junio C Hamano <hidden> Date: 2016-06-15 22:47:56
"Shawn O. Pearce" [off-list ref] writes:
Nanako Shiraishi [off-list ref] wrote:
quoted
Junio, could you tell us what happened to this thread?
The patch avoids failing completion script when git is not there.
No discussion.
Actually, that's probably my fault. I never sent an ack or nak,
or anything else really, on this thread.
Originally this was because the completion was trying to run git
as it loaded. In 1.6.6 this is no longer true, the completion list
is generated lazily on demand during the first completion attempt.
With the lazy loading, I didn't see a reason to add this ugly block
around the entire script.
Junio, could you tell us what happened to this thread?
The patch avoids failing completion script when git is not there.
No discussion.
Actually, that's probably my fault. I never sent an ack or nak,
or anything else really, on this thread.
Originally this was because the completion was trying to run git
as it loaded. In 1.6.6 this is no longer true, the completion list
is generated lazily on demand during the first completion attempt.
With the lazy loading, I didn't see a reason to add this ugly block
around the entire script.
--
Shawn.