[arch-general] Funny issue with bash-completion and __git_ps1
Hey hey After the last bash-completion and git update there is a funny issue with the Git Prompt [1]: __git_ps1 is not defined The bash-completion update moved most completion scripts to /usr/share/bash-completion/completions/ and sources them if needed. See line 1933 in: /usr/share/bash-completion/bash_completion __git_ps1 is defined in: /usr/share/bash-completion/completions/git So if you type 'git pul<TAB>' this file gets sourced and the error disappears. I worked around this by sourcing this file manually in my .bashrc My question is, where i should report this bug. Is it a git problem or a bash-completion problem. I think its a git issue, because __git_ps1 is no complete function and should be defined somewhere else... Or shall i shut my mouth and continue sourcing it in my .bashrc? [1] https://wiki.archlinux.org/index.php/Git#Git_Prompt
On Wed, Mar 28, 2012 at 08:05:48AM +0200, martin kalcher wrote:
Hey hey
After the last bash-completion and git update there is a funny issue with the Git Prompt [1]: __git_ps1 is not defined
The bash-completion update moved most completion scripts to /usr/share/bash-completion/completions/
and sources them if needed. See line 1933 in: /usr/share/bash-completion/bash_completion
__git_ps1 is defined in: /usr/share/bash-completion/completions/git
So if you type 'git pul<TAB>' this file gets sourced and the error disappears. I worked around this by sourcing this file manually in my .bashrc
My question is, where i should report this bug. Is it a git problem or a bash-completion problem. I think its a git issue, because __git_ps1 is no complete function and should be defined somewhere else... Or shall i shut my mouth and continue sourcing it in my .bashrc?
you can go on sourcing the file in your .bashrc and report the issue upstream. although my personal opinion to the whole story is pacman -Rcs, since the problems with bash-completions are old, and the symptoms are recurring, in all different shapes, and the source code is a legendary mess. cheers! mar77i
On Wed, Mar 28, 2012 at 08:49:15AM +0200, Martti Kühne wrote:
On Wed, Mar 28, 2012 at 08:05:48AM +0200, martin kalcher wrote:
Hey hey
After the last bash-completion and git update there is a funny issue with the Git Prompt [1]: __git_ps1 is not defined
The bash-completion update moved most completion scripts to /usr/share/bash-completion/completions/
and sources them if needed. See line 1933 in: /usr/share/bash-completion/bash_completion
__git_ps1 is defined in: /usr/share/bash-completion/completions/git
So if you type 'git pul<TAB>' this file gets sourced and the error disappears. I worked around this by sourcing this file manually in my .bashrc
My question is, where i should report this bug. Is it a git problem or a bash-completion problem. I think its a git issue, because __git_ps1 is no complete function and should be defined somewhere else... Or shall i shut my mouth and continue sourcing it in my .bashrc?
you can go on sourcing the file in your .bashrc and report the issue upstream. although my personal opinion to the whole story is pacman -Rcs, since the problems with bash-completions are old, and the symptoms are recurring, in all different shapes, and the source code is a legendary mess.
What would you recommend instead? I too face problems time and again with bash-completion and would like to get rid of it. Do you have some special settings in your .bashrc? -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
On 03/28/2012 03:28 AM, gt wrote:
What would you recommend instead? I too face problems time and again with bash-completion and would like to get rid of it. Do you have some special settings in your .bashrc?
No, just get rid of it. Your local bash completion will continue to work just fine without the 'bash_completion' package. I have had nothing but strange prompt issues with the package so I just finally removed it completely. Now completion and prompts work normal again -- in all situations. -- David C. Rankin, J.D.,P.E.
On Wed, Mar 28, 2012 at 01:58:51PM +0530, gt wrote:
On Wed, Mar 28, 2012 at 08:49:15AM +0200, Martti Kühne wrote:
On Wed, Mar 28, 2012 at 08:05:48AM +0200, martin kalcher wrote:
Hey hey
After the last bash-completion and git update there is a funny issue with the Git Prompt [1]: __git_ps1 is not defined
The bash-completion update moved most completion scripts to /usr/share/bash-completion/completions/
and sources them if needed. See line 1933 in: /usr/share/bash-completion/bash_completion
__git_ps1 is defined in: /usr/share/bash-completion/completions/git
So if you type 'git pul<TAB>' this file gets sourced and the error disappears. I worked around this by sourcing this file manually in my .bashrc
My question is, where i should report this bug. Is it a git problem or a bash-completion problem. I think its a git issue, because __git_ps1 is no complete function and should be defined somewhere else... Or shall i shut my mouth and continue sourcing it in my .bashrc?
you can go on sourcing the file in your .bashrc and report the issue upstream. although my personal opinion to the whole story is pacman -Rcs, since the problems with bash-completions are old, and the symptoms are recurring, in all different shapes, and the source code is a legendary mess.
What would you recommend instead? I too face problems time and again with bash-completion and would like to get rid of it. Do you have some special settings in your .bashrc?
AFAIK, the bash_completion script that is installed with the bash-completion package merely is a latch script where all other software's completion routines are sourced from '/etc/bash_completion.d'. You're free to source or not source whatever you want from that directory without the latch script installed, since it's your system/cpu time. The dependencies arising from that can be made flexible by wrapping the source with a test -f each time. That would leave you with a few additional lines in your ~/.bashrc or /etc/bash.bashrc, while keeping out the bloated mess that is bash_completion. See also, /etc/bash.bashrc line 23 cheers! mar77i
On Wed, Mar 28, 2012 at 09:19:37AM -0500, David C. Rankin wrote:
On 03/28/2012 03:28 AM, gt wrote:
What would you recommend instead? I too face problems time and again with bash-completion and would like to get rid of it. Do you have some special settings in your .bashrc?
No, just get rid of it. Your local bash completion will continue to work just fine without the 'bash_completion' package. I have had nothing but strange prompt issues with the package so I just finally removed it completely. Now completion and prompts work normal again -- in all situations.
Thanks i guess i'll remove it then. On Wed, Mar 28, 2012 at 04:19:45PM +0200, Martti Kühne wrote:
AFAIK, the bash_completion script that is installed with the bash-completion package merely is a latch script where all other software's completion routines are sourced from '/etc/bash_completion.d'. You're free to source or not source whatever you want from that directory without the latch script installed, since it's your system/cpu time. The dependencies arising from that can be made flexible by wrapping the source with a test -f each time. That would leave you with a few additional lines in your ~/.bashrc or /etc/bash.bashrc, while keeping out the bloated mess that is bash_completion. See also, /etc/bash.bashrc line 23
Thanks for the explanation, i'll take a look. -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Am 28.03.2012 08:05, schrieb martin kalcher:
Hey hey
After the last bash-completion and git update there is a funny issue with the Git Prompt [1]: __git_ps1 is not defined
The bash-completion update moved most completion scripts to /usr/share/bash-completion/completions/
and sources them if needed. See line 1933 in: /usr/share/bash-completion/bash_completion
__git_ps1 is defined in: /usr/share/bash-completion/completions/git
So if you type 'git pul<TAB>' this file gets sourced and the error disappears. I worked around this by sourcing this file manually in my .bashrc
My question is, where i should report this bug. Is it a git problem or a bash-completion problem. I think its a git issue, because __git_ps1 is no complete function and should be defined somewhere else... Or shall i shut my mouth and continue sourcing it in my .bashrc?
I just noticed this. The bash completion now uses a dynamic loading mechanism for the new path (the old compat path is still sourced unconditionally as it seems). A workaround is writing this in your .bashrc: _xfunc git __git_ps1 &>/dev/null Then everything works. Clearly, git abuses the completion file to define functions that are unrelated to completion.
participants (5)
-
David C. Rankin
-
gt
-
martin kalcher
-
Martti Kühne
-
Thomas Bächler