summaryrefslogtreecommitdiff
path: root/git-applymbox.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-10-06 21:25:52 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-06 21:25:52 (GMT)
commit47f0b6d5d49247b85898083d1ccf4f899ef7294a (patch)
treef69393968e164e20c33142923ec563eb75252583 /git-applymbox.sh
parentbc162e40ea6dc3208e3bda76301d6409607ed3ff (diff)
downloadgit-47f0b6d5d49247b85898083d1ccf4f899ef7294a.zip
git-47f0b6d5d49247b85898083d1ccf4f899ef7294a.tar.gz
git-47f0b6d5d49247b85898083d1ccf4f899ef7294a.tar.bz2
Fall back to three-way merge when applying a patch.
After git-apply fails, attempt to find a base tree that the patch cleanly applies to, and do a three-way merge using that base tree into the current index, if .dotest/.3way file exists. This flag can be controlled by giving -m flag to git-applymbox command. When the fall-back merge fails, the working tree can be resolved the same way as you would normally hand resolve a conflicting merge. When making commit, use .dotest/final-commit as the log message template. Or you could just choose to 'git-checkout-index -f -a' to revert the failed merge. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-applymbox.sh')
-rwxr-xr-xgit-applymbox.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-applymbox.sh b/git-applymbox.sh
index e2bfd02..a83246c 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/<num> | mbox) [signoff]"
+ echo >&2 "applymbox [-u] [-k] [-q] [-m] (-c .dotest/<num> | 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
@@ -56,6 +55,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