bash-git-prompt

Edit Package bash-git-prompt
No description set
Refresh
Refresh
Source Files (show unmerged sources)
Filename Size Changed
bash-git-prompt-2.7.1.tar.gz 0000050922 49.7 KB
bash-git-prompt.changes 0000000690 690 Bytes
bash-git-prompt.spec 0000004361 4.26 KB
Latest Revision
buildservice-autocommit accepted request 802493 from Michal Suchanek's avatar Michal Suchanek (michals) (revision 5)
baserev update by copy to link target
Comments 1

Lassi Väätämöinen's avatar

There's a slight bug in the package, caused by the fact that /etc/profile.d/bash-git-prompt.sh is executed via /etc/profile.

Now, the bash-git-prompt works properly when you login for example on a non-graphical TTY, or via SSH (even on localhost), as here we get a login shell.

BUT when you enter to a desktop environment, and use a terminal application, bash-git-prompt __git_ps1 gets overridden by /etc/bash_completion.d/git-prompt that comes as part of git-core, as that script is executed for non-login shell by /etc/bash.bashrc

So, the sequence of issues to the problem is here:

  1. User comes to a login screen (e.g. SDDM)
  2. LOGIN -> /etc/profile gets executed
  3. /etc/profile.d/bash-git-prompt.sh
  4. PROFILEREAD=true
  5. Open Konsole
  6. /etc/bash.bashrc (and ~/.bashrc) get executed
  7. /etc/bash_completion.d/git-prompt is executed
  8. -> overrides the previously set git prompt.
  9. -> bash-git-prompt is only usable for login shells (sudo -i, ssh, TTY), not in graphical desktop envs.

NOTE: it does not matter if for Konsole, you set startup command as '/bin/bash --login' , since PROFILEREAD=true already (I assume), so the bash-git-prompt scripts won't get run.

IMPROVEMENT: make bash-git-propmt run in the bashrc -sequence, too.

openSUSE Build Service is sponsored by