JasonKing (owner)

Forks

Revisions

gist: 151711 Download_button fork
public
Description:
git and svn tracking prompt
Public Clone URL: git://gist.github.com/151711.git
Embed All Files: show embed
.bashrc #
1
PROMPT_COMMAND='PS1="\[\e[01m\]\t \[\e[1;32m\]`~/bin/info.sh`\[\e[0m\] \[\e[33m\]\w \[\e[0m\]\[\e[1m\]\$\[\e[0m\] "'
~/bin/info.sh #
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
 
git_exists=`git branch 2>/dev/null`
 
if [[ "$git_exists" != "" ]]; then
echo "$git_exists" | grep '^*' | cut -f2 -d' '
elif [ -d .svn ]; then
svn info 2>/dev/null | grep '^URL:' | cut -f2 -d' ' | gsed 's/.*\(trunk\|\(branches\|tags\)\/[^\/]*\).*/\1/'
fi