Teach applymbox to keep the Subject: line.

This corresponds to the -k flag to git format-patch --mbox
option.  The option should probably not be used when applying a
real e-mail patch, but is needed when format-patch and applymbox
pair is used for cherrypicking.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2005-08-16 22:18:27 -07:00
parent 9577e7e3db
commit 6bff6a6068
3 changed files with 27 additions and 4 deletions

View File

@ -16,6 +16,7 @@ final=.dotest/final-commit
## If this file exists, we ask before applying
##
query_apply=.dotest/.query_apply
keep_subject=.dotest/.keep_subject
MSGFILE=$1
PATCHFILE=$2
INFO=$3
@ -30,8 +31,10 @@ export SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' .dotest/info)"
if [ -n "$signoff" -a -f "$signoff" ]; then
cat $signoff >> $MSGFILE
fi
patch_header=
test -f "$keep_subject" || patch_header='[PATCH] '
(echo "[PATCH] $SUBJECT" ; if [ -s $MSGFILE ]; then echo ; cat $MSGFILE; fi ) > $final
(echo "$patch_header$SUBJECT" ; if [ -s $MSGFILE ]; then echo ; cat $MSGFILE; fi ) > $final
f=0
[ -f $query_apply ] || f=1