aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-10-25 23:35:37 -0700
committerJunio C Hamano <junkio@cox.net>2005-10-25 23:35:37 -0700
commit271440e3b65f0c599e19fdd6bc07aeccc16699fb (patch)
tree904bc6f6b95ae8e3f2dd450334dac1a2a5ed8007
parent129adf4d668d04c875bfd7207ba60547b066d5af (diff)
downloadgit-271440e3b65f0c599e19fdd6bc07aeccc16699fb.tar.gz
git-271440e3b65f0c599e19fdd6bc07aeccc16699fb.tar.xz
git-am: make it easier after fixing up an unapplicable patch.
Instead of having the user to edit the mail message, let the hand merge result stored in .dotest/patch and continue, which is easier to manage. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--Documentation/git-am.txt8
-rwxr-xr-xgit-am.sh14
2 files changed, 14 insertions, 8 deletions
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 9de2df115..704dc514d 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -58,10 +58,10 @@ recover from this in one of two ways:
. hand resolve the conflict in the working directory, run 'git
diff HEAD' to extract the merge result into a patch form and
- replacing the patch part of the message in .dotest directory.
- After doing this, run `git-reset --hard HEAD` to bring the
- working tree to the state before half-applying the patch, then
- re-run the command without any options.
+ replacing the patch in .dotest/patch file. After doing this,
+ run `git-reset --hard HEAD` to bring the working tree to the
+ state before half-applying the patch, then re-run the command
+ without any options.
The command refuses to process new mailboxes while `.dotest`
directory exists, so if you decide to start over from scratch,
diff --git a/git-am.sh b/git-am.sh
index 51ea168e0..fd0772d90 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -153,6 +153,7 @@ if test -d "$dotest"
then
test ",$#," = ",0," ||
die "previous dotest directory $dotest still exists but mbox given."
+ resume=yes
else
# Make sure we are not given --skip
test ",$skip," = ,, ||
@@ -215,10 +216,15 @@ do
go_next
continue
}
- git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
- <"$dotest/$msgnum" >"$dotest/info" ||
- stop_here $this
- git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
+ case "$resume" in
+ '')
+ git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
+ <"$dotest/$msgnum" >"$dotest/info" ||
+ stop_here $this
+ git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
+ ;;
+ esac
+ resume=
GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"