summaryrefslogtreecommitdiffstats
path: root/tasks/rake
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-09 13:35:59 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-09 13:35:59 -0800
commit631c5a8e455808dbc919211b5151fd501f6475c9 (patch)
treeb2fad5f1fb9efd52b3a6192471099c57db1c16a3 /tasks/rake
parent0aab84ffa6721acbe16b64263bbab4134652e734 (diff)
downloadpuppet-631c5a8e455808dbc919211b5151fd501f6475c9.tar.gz
puppet-631c5a8e455808dbc919211b5151fd501f6475c9.tar.xz
puppet-631c5a8e455808dbc919211b5151fd501f6475c9.zip
Maint: Add "Local-branch:" info to mails sent by "rake mail_patches"
Diffstat (limited to 'tasks/rake')
-rw-r--r--tasks/rake/git_workflow.rake13
1 files changed, 12 insertions, 1 deletions
diff --git a/tasks/rake/git_workflow.rake b/tasks/rake/git_workflow.rake
index b2f96c603..c275bba3f 100644
--- a/tasks/rake/git_workflow.rake
+++ b/tasks/rake/git_workflow.rake
@@ -103,10 +103,21 @@ task :mail_patches do
# Create all of the patches
sh "git format-patch -C -M -s -n --subject-prefix='PATCH/puppet' #{parent}..HEAD"
+ # Add info to the patches
+ additional_info = "Local-branch: #{branch}\n"
+ files = Dir.glob("00*.patch")
+ files.each do |file|
+ contents = File.read(file)
+ contents.sub!(/^---$/, "#{additional_info}---")
+ File.open(file, 'w') do |file_handle|
+ file_handle.print contents
+ end
+ end
+
# And then mail them out.
# If we've got more than one patch, add --compose
- if Dir.glob("00*.patch").length > 1
+ if files.length > 1
compose = "--compose"
else
compose = ""