Added git-pull-all-branches. Removed svnst cruft.

This commit is contained in:
Sami Samhuri 2010-04-11 16:40:33 -07:00
parent aade651214
commit c12a37f8e8

View file

@ -238,6 +238,7 @@ alias glo='git log --oneline'
alias gls='git log --stat' alias gls='git log --stat'
alias g='git grep' alias g='git grep'
alias m='git merge' alias m='git merge'
alias pab='git-pull-all-branches'
alias r='git remote' alias r='git remote'
alias ra='git remote add' alias ra='git remote add'
alias s='git status' alias s='git status'
@ -247,27 +248,19 @@ if mac; then
alias -g apache2ctl=/opt/local/apache2/bin/apachectl alias -g apache2ctl=/opt/local/apache2/bin/apachectl
fi fi
function svnst() { git-pull-all-branches() {
tmpfile=/tmp/svn-stat.$$ if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
[[ -f $tmpfile ]] && rm -f $tmpfile echo "$pwd is not part of a git repo"
svn stat return
svn diff > $tmpfile
typeset -i added deled delta
added=`grep '^+' $tmpfile | wc -l`
deled=`grep '^-' $tmpfile | wc -l`
delta=$((added - deled))
if [[ delta -gt 0 ]]; then
delta_w=added
delta_sym='+'
else
delta_w=deleted
delta_sym='-'
delta=$((0 - delta))
fi fi
echo " + ${added} lines" origbranch=$(git branch | fgrep '*' | sed -e 's/\*//')
echo " - ${deled} lines" bs=($@)
echo "= ${delta_sym} ${delta} lines" [[ -z "$bs" ]] && bs=($(git branch | sed -e 's/\*//'))
rm -f $tmpfile for b ($bs) {
git checkout "$b"
git pull origin "$b"
}
git checkout "$origbranch"
} }
function e() { function e() {