FS#29141 - [git] Put Git's bash-completion script back into /etc/bash_completion.d
Attached to Project:
Arch Linux
Opened by Kerrick Staley (KerrickStaley) - Wednesday, 28 March 2012, 04:42 GMT
Last edited by Dan McGee (toofishes) - Tuesday, 03 April 2012, 19:35 GMT
Opened by Kerrick Staley (KerrickStaley) - Wednesday, 28 March 2012, 04:42 GMT
Last edited by Dan McGee (toofishes) - Tuesday, 03 April 2012, 19:35 GMT
|
Details
Git's script for bash_completion not only defines
completions but also defines some functions such as
__git_ps1.
The git-1.7.9.4-1 PKGBUILD has this line: install -m644 ./contrib/completion/git-completion.bash "$pkgdir"/etc/bash_completion.d/git The git-1.7.9.5-1 PKGBUILD has this line: install -m644 ./contrib/completion/git-completion.bash "$pkgdir"/usr/share/bash-completion/completions/git Installing in the original location causes the script to run whenever bash starts. Now, it only runs when you try to autocomplete a git command, and so the __git_ps1 function isn't available when you first open the shell. Related forum topic: https://bbs.archlinux.org/viewtopic.php?id=138210 |
This task depends upon
Closed by Dan McGee (toofishes)
Tuesday, 03 April 2012, 19:35 GMT
Reason for closing: Fixed
Additional comments about closing: 1.7.5.6-1, awaiting changes upstream for a split file
Tuesday, 03 April 2012, 19:35 GMT
Reason for closing: Fixed
Additional comments about closing: 1.7.5.6-1, awaiting changes upstream for a split file
It would be great if you could see what upstream git has to think about this, or how they plan on solving it. It seems like the bash-completion file will no longer be able to pull double-duty.
__git_ps1 is a long standing feature of the bash_completion in git source's contrib (I know, because I've contributed to it). It's not going away.
Either the git package needs to put git back in /etc/bash_completion.d, or a second bash-completion-static should be put there with __git_ps1. Otherwise, a lot of PS1 prompts will be broken.
Someone could try to convince gitster et al. to create a bash-completion-static that contains __git_ps1, but my guess is that there will be resistance to this approach unless it becomes common to split completion scripts into a dynamic and static part.
$ ln -s /usr/share/bash-completion/completions/git /etc/bash_completion.d/git
And the analysis is exact. (checked with echo statements)