Skip to content

Instantly share code, notes, and snippets.

@jamiew
jamiew / pimp_prompt.sh
Created January 21, 2011 17:55
put this in your .bashrc/.bash_profile... works with both git and svn
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
[ "$REV" ] || return
[ "$(svn st)" ] && DIRTY=' *'
echo "(r$REV$DIRTY)"
[user]
name = Jamie Wilkinson
email = jamie@jamiedubs.com
[github]
user = jamiew
token = <REDACTED>
[apply]
whitespace = nowarn
[branch]
autosetuprebase = always
@wtowns
wtowns / p4merge Windows settings
Created October 7, 2010 18:13
.gitconfig settings to use p4merge in Windows
[diff]
tool = p4merge
[difftool "p4merge"]
cmd = "p4merge.exe $LOCAL $REMOTE"
[merge]
tool = p4merge
[mergetool "p4merge"]
cmd = "p4merge.exe $BASE $LOCAL $REMOTE $MERGED"
trustExitCode = true
keepBackup = false