Created
May 30, 2013 21:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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