Skip to content

Instantly share code, notes, and snippets.

@haochong
Created February 1, 2013 09:35
Show Gist options
  • Save haochong/4690357 to your computer and use it in GitHub Desktop.
Save haochong/4690357 to your computer and use it in GitHub Desktop.
Mac OSX Bash Script to print the svn log committed by specific user this week
#!/bin/bash
split=""
monday=`date -v-Monday "+%Y-%m-%d"`
friday=`date -v+Friday "+%Y-%m-%d"`
userlen=`echo "$1" | wc -c`
printlen=$((userlen+38))
for (( i=0; i<= $printlen; i++ ))
do
split+="="
done
echo "$split"
echo "svn log by $1 {$monday} ~ {$friday}"
echo "$split"
svn log --revision {"$monday"}:{"$friday"} | sed -n "/"$1"/,/-----$/ p"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment