Allow adding arbitary lines in the mail header generated by format-patch.
Entries may be added to the config file as follows: [format] headers = "Organization: CodeWeavers\nTo: wine-patches <wine-patches@winehq.org>\n" Signed-off-by: Junio C Hamano <junkio@cox.net>
Mike McCormack committed
Mar 6, 2006 at 22:10 UTC
00333ca35c5986e44d4cd4fd59433200d916f77e
1 file changed
+6
-2
git-format-patch.sh
+6
-2
@@ -149,6 +149,7 @@ do
149
done >$series
150
151
me=`git-var GIT_AUTHOR_IDENT | sed -e 's/>.*/>/'`
152
+headers=`git-repo-config --get format.headers`
153
154
case "$outdir" in
155
*/) ;;
@@ -173,7 +174,7 @@ titleScript='
174
175
process_one () {
176
perl -w -e '
176
-my ($keep_subject, $num, $signoff, $commsg) = @ARGV;
177
+my ($keep_subject, $num, $signoff, $headers, $commsg) = @ARGV;
178
my ($signoff_pattern, $done_header, $done_subject, $done_separator, $signoff_seen,
179
$last_was_signoff);
180
@@ -224,6 +225,9 @@ while (<FH>) {
225
s/^\[PATCH[^]]*\]\s*//;
226
s/^/[PATCH$num] /;
227
}
228
+ if ($headers) {
229
+ print "$headers\n";
230
+ }
231
print "Subject: $_";
232
$done_subject = 1;
233
next;
@@ -250,7 +254,7 @@ if (!$signoff_seen && $signoff ne "") {
254
}
255
print "\n---\n\n";
256
close FH or die "close $commsg pipe";
253
-' "$keep_subject" "$num" "$signoff" $commsg
257
+' "$keep_subject" "$num" "$signoff" "$headers" $commsg
258
259
git-diff-tree -p $diff_opts "$commit" | git-apply --stat --summary
260
echo