Skip to content

Instantly share code, notes, and snippets.

@James-Firth
Created May 30, 2013 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save James-Firth/5681517 to your computer and use it in GitHub Desktop.
Save James-Firth/5681517 to your computer and use it in GitHub Desktop.
CVS commit histories are file-by-file so I wanted to create a script that would check the changes, create a full changelog and email the results to me. NOTE: The regex on line 15 would need to be changed. This looks for the first UofM username, which starts with "um" all the time.
#!/bin/sh
cd /path/to/local/cvs/repo/
output="$(cvs -qn update)"
echo $output
if [ -x "$output"]
then
echo "No Updates."
else
echo "New commit available!"
echo "Updating..."
cvs update -C -d
echo "Creating ChangeLog..."
cvs2cl;
sleep 2
person="$(grep -o -m 1 'um*\w*' ChangeLog)"
echo $person
echo "Sending email..."
mail -s "New Commit by $person. Full ChangeLog Below" YOU@DOMAIN.COM < ChangeLog
sleep 2
echo "Removing ChangeLog..."
rm -f ChangeLog
echo "Mission Complete."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment