1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-07 09:43:00 +01:00
git/dotest
James Bottomley ad4e9ce4f9 [PATCH] make dotest more amenable to commit message editing
This makes "dotest" a lot nicer to sue, especially for people who were
used to editing the commit comments after-the-fact in BK, which git
doesn't apply. 

he syntax is

	dotest [-q] mailbox [signoff]

so the command line operates exactly as you're used to.  If you supply
the -q it will query before applying (I also added the [a]pply all the
rest option).  If the signoff file is absent, no signoff line gets
added. 

There's also one addition in this:  a checkout-cache line.  I added that
for poor saps like me whose laptop takes minutes to checkout a full
build tree, so I can run dotest in a directory with no checked out
files.
2005-04-20 08:23:00 -07:00

32 lines
893 B
Bash
Executable file

#!/bin/sh
##
## "dotest" is my stupid name for my patch-application script, which
## I never got around to renaming after I tested it. We're now on the
## second generation of scripts, still called "dotest".
##
## You give it a mbox-format collection of emails, and it will try to
## apply them to the kernel using "applypatch"
##
## dotest [ -q ] mail_archive [Signoff_file]
##
rm -rf .dotest
mkdir .dotest
case $1 in
-q) touch .dotest/.query_apply
shift;;
esac
mailsplit $1 .dotest || exit 1
for i in .dotest/*
do
mailinfo .dotest/msg .dotest/patch .dotest/file < $i > .dotest/info || exit 1
applypatch .dotest/msg .dotest/patch .dotest/file .dotest/info "$2"
ret=$?
if [ $ret -ne 0 ]; then
# 2 is a special exit code from applypatch to indicate that
# the patch wasn't applied, but continue anyway
[ $ret -ne 2 ] && exit $ret
fi
done
# return to pristine
rm -fr .dotest