[Bash-completion-devel] bash-completion now loads completions dynamically, so __git_ps1 is not defined when you open a shell

Jeff King peff at peff.net
Thu Mar 29 05:49:43 UTC 2012


On Wed, Mar 28, 2012 at 07:00:35PM -0500, Kerrick Staley wrote:

> bash-completion 1.99 (still a "beta", but Arch Linux now ships it)
> will automatically source the git-completion.bash script when you type
> git <tab>. The script is no longer sourced when you first open a
> shell.
> 
> There are two main ways to fix this:
> 1) define __git_ps1 (and friends) in a different script, which will
> get installed in /etc/profile.d (this is the "proper way")
> 2) require that git-completion.bash always be loaded in the beginning
> instead of on-the-fly (which is how it works now now)

I would much rather see (1). There is a very good reason for
bash-completion doing dynamic loading, which is that loading all of the
completions made shell startup horribly slow. We should do our part to
help keep startup fast by splitting the dynamically-loadable bits from
the must-be-loaded-at-start bits.

-Peff



More information about the Bash-completion-devel mailing list