X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-applymbox.sh;h=4e77132ab5f73839241c430d6354d5abb8294d85;hb=e11fc02066435b0f370d639e665ec70680e876a6;hp=e2bfd0287057b5eb712018574bef1790993ca743;hpb=215a7ad1ef790467a4cd3f0dcffbd6e5f04c38f7;p=git.git diff --git a/git-applymbox.sh b/git-applymbox.sh index e2bfd028..4e77132a 100755 --- a/git-applymbox.sh +++ b/git-applymbox.sh @@ -9,8 +9,6 @@ ## You give it a mbox-format collection of emails, and it will try to ## apply them to the kernel using "applypatch" ## -## applymbox [-u] [-k] [-q] (-c .dotest/msg-number | mail_archive) [Signoff_file]" -## ## The patch application may fail in the middle. In which case: ## (1) look at .dotest/patch and fix it up to apply ## (2) re-run applymbox with -c .dotest/msg-number for the current one. @@ -21,7 +19,7 @@ . git-sh-setup || die "Not a git archive" usage () { - echo >&2 "applymbox [-u] [-k] [-q] (-c .dotest/ | mbox) [signoff]" + echo >&2 "applymbox [-u] [-k] [-q] [-m] (-c .dotest/ | mbox) [signoff]" exit 1 } @@ -33,6 +31,7 @@ do -k) keep_subject=-k ;; -q) query_apply=t ;; -c) continue="$2"; resume=f; shift ;; + -m) fallback_3way=t ;; -*) usage ;; *) break ;; esac @@ -43,7 +42,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 @@ -56,6 +56,9 @@ fi case "$query_apply" in t) touch .dotest/.query_apply esac +case "$fall_back_3way" in +t) : >.dotest/.3way +esac case "$keep_subject" in -k) : >.dotest/.keep_subject esac @@ -80,7 +83,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 ;;