Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.