diff options
| author | James Turnbull <james@lovedthanlost.net> | 2009-08-02 02:15:34 +1000 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-08-02 02:16:38 +1000 |
| commit | 36c0662f13b0f00fe0b75ba45f892a1c7c3218bf (patch) | |
| tree | ad1cdf4aeaa1aa12dac39b7e522558dec4a9bb2f /tasks/rake/mail_patches.rake | |
| parent | b45ccf8d38a10d3f5226cbabe494240901e4e383 (diff) | |
| download | puppet-36c0662f13b0f00fe0b75ba45f892a1c7c3218bf.tar.gz puppet-36c0662f13b0f00fe0b75ba45f892a1c7c3218bf.tar.xz puppet-36c0662f13b0f00fe0b75ba45f892a1c7c3218bf.zip | |
Simplified Rakefile and moved tasks to tasks/rake directorya
Diffstat (limited to 'tasks/rake/mail_patches.rake')
| -rw-r--r-- | tasks/rake/mail_patches.rake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tasks/rake/mail_patches.rake b/tasks/rake/mail_patches.rake new file mode 100644 index 000000000..82455e87f --- /dev/null +++ b/tasks/rake/mail_patches.rake @@ -0,0 +1,35 @@ +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 --subject-prefix='PATCH/puppet' #{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-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch" + + # Finally, clean up the patches + sh "rm 00*.patch" +end |
