Created
April 22, 2014 13:52
-
-
Save wxg4net/11180087 to your computer and use it in GitHub Desktop.
git ptc for send email
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
#!/usr/bin/bash | |
num=1 | |
if [ $# -gt 0 ]; then | |
num=$1 | |
fi | |
git config --get core.email > /dev/null | |
if [ $? -ne 0 ]; then | |
exit 0 | |
fi | |
glist=$(git diff --name-only HEAD HEAD~$num) | |
echo '准备附件...' | |
tar --ignore-failed-read -zcf /tmp/latest.tar.gz $(git diff --name-only HEAD HEAD~$num) | |
glog=$(git log --pretty=oneline --max-count=$num) | |
gfirst=$(git log --pretty="%s" --max-count=1) | |
gemail=$(git config --get core.email) | |
echo '准备邮件...' | |
echo "$glog" | mutt -s "修改:$gfirst" $gemail -a /tmp/latest.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment