Mercurial – branch w bash prompt

Teraz na szybko ;)
Aby osiągnąć taki efekt:

noose@noose-laptop ~/projekt_1/ (branch)$

należy do .bash_profiles wpisać:

function parse_hg_branch {
    ref=$(hg branch 2> /dev/null) || return
    echo "("${ref#refs/heads/}")"
}
PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$(parse_hg_branch)$\[\033[00m\] "

źródło: http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]