]> git.ipfire.org Git - thirdparty/git.git/blob - tools/applymbox
Add "Index: " to the list of things that start a patch
[thirdparty/git.git] / tools / applymbox
1 #!/bin/sh
2 ##
3 ## "dotest" is my stupid name for my patch-application script, which
4 ## I never got around to renaming after I tested it. We're now on the
5 ## second generation of scripts, still called "dotest".
6 ##
7 ## Update: Ryan Anderson finally shamed me into naming this "applymbox".
8 ##
9 ## You give it a mbox-format collection of emails, and it will try to
10 ## apply them to the kernel using "applypatch"
11 ##
12 ## dotest [ -q ] mail_archive [Signoff_file]
13 ##
14 rm -rf .dotest
15 mkdir .dotest
16 case $1 in
17
18 -q) touch .dotest/.query_apply
19 shift;;
20 esac
21 mailsplit $1 .dotest || exit 1
22 for i in .dotest/*
23 do
24 mailinfo .dotest/msg .dotest/patch < $i > .dotest/info || exit 1
25 git-stripspace < .dotest/msg > .dotest/msg-clean
26 applypatch .dotest/msg-clean .dotest/patch .dotest/info "$2"
27 ret=$?
28 if [ $ret -ne 0 ]; then
29 # 2 is a special exit code from applypatch to indicate that
30 # the patch wasn't applied, but continue anyway
31 [ $ret -ne 2 ] && exit $ret
32 fi
33 done
34 # return to pristine
35 rm -fr .dotest