Re: StGit-enabled bash-prompt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Oct 2006, Robin Rosenberg wrote:

> Of course you will read and understand this code. I don't know how good an 
> idea it is to use the DEBUG trap this way.

I set my prompt without using it, with something approximating this
being defined in my .bash_profile. I think the use of ' instead of " 
causes evaluation of __prompt_githead be delayed until the prompt is 
displayed.


  PS1='$(__prompt_githead) '$PS1

  __prompt_githead() {
  PS_GIT=$(git-symbolic-ref HEAD 2>/dev/null) || exit
  echo -n " $(basename $PS_GIT)" 
  }

-- 

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]