Maint: add "Local-branch:" info to mails sent by "rake mail_patches"
Paul Berry
13 years ago
17 | 17 | # Create all of the patches |
18 | 18 | sh "git format-patch -C -M -s -n --subject-prefix='PATCH/facter' #{parent}..HEAD" |
19 | 19 | |
20 | # Add info to the patches | |
21 | additional_info = "Local-branch: #{branch}\n" | |
22 | files = Dir.glob("00*.patch") | |
23 | files.each do |file| | |
24 | contents = File.read(file) | |
25 | contents.sub!(/^---\n/, "---\n#{additional_info}") | |
26 | File.open(file, 'w') do |file_handle| | |
27 | file_handle.print contents | |
28 | end | |
29 | end | |
30 | ||
20 | 31 | # And then mail them out. |
21 | 32 | |
22 | 33 | # If we've got more than one patch, add --compose |
23 | if Dir.glob("00*.patch").length > 1 | |
34 | if files.length > 1 | |
24 | 35 | compose = "--compose" |
25 | 36 | else |
26 | 37 | compose = "" |