-
-
Save EnriqueVidal/827198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT_COMMAND=$PROMPT_COMMAND${PROMPT_COMMAND:+;}'PS1="\[\e[01m\]\t\[\e[0m\] \[\e[1;32m\]`~/bin/branch.sh`\[\e[0m\]\[\e[1;35m\]`~/bin/stash.sh`\[\e[0m\]\[\e[33m\]\w \[\e[0m\]\[\e[1m\]\$\[\e[0m\] "' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ~/bin/branch.sh | |
# NOTE: you'll need `gsed` - ie. GNU sed for the svn one to work | |
git_exists=`git branch 2>/dev/null | grep '^*' | cut -f2- -d' '` | |
if [[ "$git_exists" != "" ]]; then | |
echo "$git_exists " | |
elif [ -d .svn ]; then | |
svn info 2>/dev/null | grep '^URL:' | cut -f2 -d' ' | gsed 's/.*\(trunk\|\(branches\|tags\)\/[^\/]*\).*/\1 /' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ~/bin/stash.sh | |
git_exists=`git stash list 2>/dev/null | wc -l | sed 's/ *//g'` | |
if [[ "$git_exists" != "" && $git_exists > 0 ]]; then | |
echo "[$git_exists] " | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment