summaryrefslogtreecommitdiff
path: root/tools/git-applypatch
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-17 05:18:27 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-17 05:22:35 (GMT)
commit6bff6a60680ef402f614abae8189c2cb198cfa49 (patch)
treea78ad829aefcc7ae100fe9b6547ee3f0cb0b5738 /tools/git-applypatch
parent9577e7e3db2299febdc17539478bba38874d4120 (diff)
downloadgit-6bff6a60680ef402f614abae8189c2cb198cfa49.zip
git-6bff6a60680ef402f614abae8189c2cb198cfa49.tar.gz
git-6bff6a60680ef402f614abae8189c2cb198cfa49.tar.bz2
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>
Diffstat (limited to 'tools/git-applypatch')
-rwxr-xr-xtools/git-applypatch5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/git-applypatch b/tools/git-applypatch
index 5a3a44b..406fef3 100755
--- a/tools/git-applypatch
+++ b/tools/git-applypatch
@@ -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