‘Know which branch we’re on’ on Ubuntu 16

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

‘Know which branch we’re on’ on Ubuntu 16

Simon Albrecht-2
Hello,

finally I’ve managed to get Ubuntu 16.04 working, and copied all of my
previous home directory including .bashrc. However, the ‘export PS1’
trick suggested in
<http://lilypond.org/doc/v2.19/Documentation/contributor/setting-up#configuring-git>
with the following line in .bashrc:

export PS1="\u@\h \w\$(__git_ps1)$ "

doesn’t seem to work the same anymore: upon any command I execute in the
terminal I get an error message ‘__git_ps1: command not found’. Can
anyone give me a hint how to update this?

Best, Simon


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: ‘Know which branch we’re on’ on Ubuntu 16

Federico Bruni-2


Il giorno dom 4 giu 2017 alle 17:58, Simon Albrecht
<[hidden email]> ha scritto:

> Hello,
>
> finally I’ve managed to get Ubuntu 16.04 working, and copied all of
> my previous home directory including .bashrc. However, the ‘export
> PS1’ trick suggested in
> <http://lilypond.org/doc/v2.19/Documentation/contributor/setting-up#configuring-git>
> with the following line in .bashrc:
>
> export PS1="\u@\h \w\$(__git_ps1)$ "
>
> doesn’t seem to work the same anymore: upon any command I execute
> in the terminal I get an error message ‘__git_ps1: command not
> found’. Can anyone give me a hint how to update this?
>
>

Did you source git-prompt.sh (where __git_ps1 is defined)?
In Fedora I have:

source /usr/share/git-core/contrib/completion/git-prompt.sh
export PS1='[\W$(declare -F __git_ps1 &>/dev/null && __git_ps1 "
(%s)")]\$ '
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true

This is for Fedora, but the rationale should be the same on Ubuntu:
https://fedoraproject.org/wiki/Git_quick_reference#Display_current_branch_in_bash




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: ‘Know which branch we’re on’ on Ubuntu 16

David Kastrup
In reply to this post by Simon Albrecht-2
Simon Albrecht <[hidden email]> writes:

> Hello,
>
> finally I’ve managed to get Ubuntu 16.04 working, and copied all of my
> previous home directory including .bashrc. However, the ‘export PS1’
> trick suggested in
> <http://lilypond.org/doc/v2.19/Documentation/contributor/setting-up#configuring-git>
> with the following line in .bashrc:
>
> export PS1="\u@\h \w\$(__git_ps1)$ "
>
> doesn’t seem to work the same anymore: upon any command I execute in
> the terminal I get an error message ‘__git_ps1: command not
> found’. Can anyone give me a hint how to update this?

The manual also says:

    You may need to install the additional bash-completion package, but
    it is definitely worth it. After installation you must log out, and
    then log back in again to enable it.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: ‘Know which branch we’re on’ on Ubuntu 16

Simon Albrecht-2
On 04.06.2017 19:02, David Kastrup wrote:

> Simon Albrecht <[hidden email]> writes:
>> Hello,
>>
>> finally I’ve managed to get Ubuntu 16.04 working, and copied all of my
>> previous home directory including .bashrc. However, the ‘export PS1’
>> trick suggested in
>> <http://lilypond.org/doc/v2.19/Documentation/contributor/setting-up#configuring-git>
>> with the following line in .bashrc:
>>
>> export PS1="\u@\h \w\$(__git_ps1)$ "
>>
>> doesn’t seem to work the same anymore: upon any command I execute in
>> the terminal I get an error message ‘__git_ps1: command not
>> found’. Can anyone give me a hint how to update this?
> The manual also says:
>
>      You may need to install the additional bash-completion package, but
>      it is definitely worth it. After installation you must log out, and
>      then log back in again to enable it.

I did check for that: bash-completion had already been installed. But
the solution was even dumber: Embarrassingly I didn’t have git
installed… sorry for the noise ;-)

Best, Simon

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel