diff options
author | Luke Kanies <luke@madstop.com> | 2008-10-01 19:20:05 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-10-02 13:36:26 +1000 |
commit | 655f378af38ff5cd5593f7f7dbb6e77fdda2864a (patch) | |
tree | ebbd79132df84c1478805739df6589536d41eecf | |
parent | d39bab9a02abf139f83e63634cfded5c5b42b14c (diff) | |
download | puppet-655f378af38ff5cd5593f7f7dbb6e77fdda2864a.tar.gz puppet-655f378af38ff5cd5593f7f7dbb6e77fdda2864a.tar.xz puppet-655f378af38ff5cd5593f7f7dbb6e77fdda2864a.zip |
Adding a rake task for sending emails to the dev list
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | Rakefile | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -161,3 +161,39 @@ desc "Run the unit tests" task :unit do sh "cd test; rake" end + +desc "Send patch information to the puppet-dev list" +task :mail_patches do + if Dir.glob("00*.patch").length > 0 + raise "Patches already exist matching '00*.patch'; clean up first" + end + + unless %x{git status} =~ /On branch (.+)/ + raise "Could not get branch from 'git status'" + end + branch = $1 + + unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$} + raise "Branch name does not follow <type>/<parent>/<name> model; cannot autodetect parent branch" + end + + type, parent, name = $1, $2, $3 + + # Create all of the patches + sh "git-format-patch -C -M -s -n #{parent}..HEAD" + + # And then mail them out. + + # If we've got more than one patch, add --compose + if Dir.glob("00*.patch").length > 1 + compose = "--compose" + else + compose = "" + end + + # Now send the mail. + sh "git send-email #{compose} --no-chain-reply-to --no-signed-off-by-cc --suppress-from --no-thread --to puppet-dev@googlegroups.com 00*.patch" + + # Finally, clean up the patches + sh "rm 00*.patch" +end |