X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-applymbox.sh;h=24d4a8cb4eb95a5201c205be879d3ac6a62a8a15;hb=562051809589574576971c53c23aad93f8c395d9;hp=a83246cad86c1dc589a226420891074e7017ccfc;hpb=47f0b6d5d49247b85898083d1ccf4f899ef7294a;p=git.git diff --git a/git-applymbox.sh b/git-applymbox.sh index a83246ca..24d4a8cb 100755 --- a/git-applymbox.sh +++ b/git-applymbox.sh @@ -15,8 +15,10 @@ ## Pay a special attention to the commit log message if you do this and ## use a Signoff_file, because applypatch wants to append the sign-off ## message to msg-clean every time it is run. +## +## git-am is supposed to be the newer and better tool for this job. -. git-sh-setup || die "Not a git archive" +. git-sh-setup usage () { echo >&2 "applymbox [-u] [-k] [-q] [-m] (-c .dotest/ | mbox) [signoff]" @@ -42,7 +44,8 @@ case "$continue" in '') rm -rf .dotest mkdir .dotest - git-mailsplit "$1" .dotest || exit 1 + num_msgs=$(git-mailsplit "$1" .dotest) || exit 1 + echo "$num_msgs patch(es) to process." shift esac @@ -82,7 +85,11 @@ do do git-applypatch .dotest/msg-clean .dotest/patch .dotest/info "$signoff" case "$?" in - 0 | 2 ) + 0) + # Remove the cleanly applied one to reduce clutter. + rm -f .dotest/$i + ;; + 2) # 2 is a special exit code from applypatch to indicate that # the patch wasn't applied, but continue anyway ;;