Last active
November 8, 2015 03:35
-
-
Save bageljp/eb697f5bdb9292749241 to your computer and use it in GitHub Desktop.
SVN commit mail
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 | |
export LANG=ja_JP.utf8 | |
REPOS="$1" | |
REV="$2" | |
# コミットユーザ | |
COMMIT_AUTOER=`svnlook author -r ${REV} ${REPOS}` | |
# コミットログ | |
COMMIT_LOG=`svnlook log -r ${REV} ${REPOS}` | |
# コミットファイル | |
COMMIT_FILES=`svnlook changed -r ${REV} ${REPOS}` | |
# コミット日時 | |
COMMIT_DATE=`svnlook date -r ${REV} ${REPOS}` | |
# コミット差分 | |
COMMIT_DIFF=`svnlook diff -r ${REV} ${REPOS}` | |
# メール設定 | |
SUBJECT="[KADO101-SVN r${REV}] Committed by ${COMMIT_AUTOER}" | |
FROM_ADDR="from@example.com" | |
TO_ADDR="to@example.com" | |
send_flg=0 | |
#IFS=$'\n' | |
for path in $(echo "${COMMIT_FILES}"); do | |
if [ `dirname ${path}` == 'keyence_web' ]; then | |
send_flg=1 | |
fi | |
done | |
if [ ${send_flg} -ne 0 ]; then | |
mail -r ${FROM_ADDR} \ | |
-s "${SUBJECT}" \ | |
${TO_ADDR} << _EOM_ | |
Subversion committed to ${REPOS} ${REV} | |
Updated by ${COMMIT_AUTOER} | |
Modified ${COMMIT_DATE} | |
# Log: | |
---------------------------------------------------------------------------------------------------------------- | |
${COMMIT_LOG} | |
# Changed: [U:update A:add D:delete] | |
---------------------------------------------------------------------------------------------------------------- | |
${COMMIT_FILES} | |
# Diff: | |
---------------------------------------------------------------------------------------------------------------- | |
${COMMIT_DIFF} | |
_EOM_ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment