summaryrefslogtreecommitdiffstats
path: root/tasks/rake/mail_patches.rake
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-12 10:26:31 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-12 10:26:31 -0800
commit1eef8424c21f6efb8d70d720834e995c20a6b2b4 (patch)
tree6521c665b5339e9d67cd27057ade8bb908ea9513 /tasks/rake/mail_patches.rake
parent06fb622e293100b214ac0de4f9d09d06dcbdb36e (diff)
downloadfacter-1eef8424c21f6efb8d70d720834e995c20a6b2b4.tar.gz
facter-1eef8424c21f6efb8d70d720834e995c20a6b2b4.tar.xz
facter-1eef8424c21f6efb8d70d720834e995c20a6b2b4.zip
Maint: add "Local-branch:" info to mails sent by "rake mail_patches"
Diffstat (limited to 'tasks/rake/mail_patches.rake')
-rw-r--r--tasks/rake/mail_patches.rake13
1 files changed, 12 insertions, 1 deletions
diff --git a/tasks/rake/mail_patches.rake b/tasks/rake/mail_patches.rake
index 6375a22..be8dda1 100644
--- a/tasks/rake/mail_patches.rake
+++ b/tasks/rake/mail_patches.rake
@@ -18,10 +18,21 @@ task :mail_patches do
# Create all of the patches
sh "git format-patch -C -M -s -n --subject-prefix='PATCH/facter' #{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!(/^---\n/, "---\n#{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 = ""