Skip to content

Instantly share code, notes, and snippets.

@werm098
Created July 18, 2017 16:52
Show Gist options
  • Save werm098/188e2aac82c6b5369e15f9ba2d112726 to your computer and use it in GitHub Desktop.
Save werm098/188e2aac82c6b5369e15f9ba2d112726 to your computer and use it in GitHub Desktop.
Simple bash function to log SVN commit messages for the day
function svnlog() {
local hoursAgo=12
if [ "$1" ]; then
hoursAgo=$1
fi
local dateThen=$(date -v-"$hoursAgo"H "+%Y-%m-%d %H:%M:%S")
local dateNow=$(date "+%Y-%m-%d %H:%M:%S")
echo "SVN LOG: $(date "+%Y-%m-%d")"
svn log --search "{{ SVN username }}" -r "{$dateThen}:{$dateNow}" {{ SVN URL }} \
| grep -v -e "| {{ SVN username }} |" -e "^br$" -e "^$" -e "-----"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment