@matheusbsbs / matheus-bagliano / commits / 271440e3b6
Fork 0

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>

Junio C Hamano committed Oct 25, 2005 at 23:35 UTC 271440e3b65f0c599e19fdd6bc07aeccc16699fb
2 files changed +14 -8
Documentation/git-am.txt
+4 -4
@@ -58,10 +58,10 @@ recover from this in one of two ways:
58
59 . hand resolve the conflict in the working directory, run 'git
60 diff HEAD' to extract the merge result into a patch form and
61 - replacing the patch part of the message in .dotest directory.
62 - After doing this, run `git-reset --hard HEAD` to bring the
63 - working tree to the state before half-applying the patch, then
64 - re-run the command without any options.
61 + replacing the patch in .dotest/patch file. After doing this,
62 + run `git-reset --hard HEAD` to bring the working tree to the
63 + state before half-applying the patch, then re-run the command
64 + without any options.
65
66 The command refuses to process new mailboxes while `.dotest`
67 directory exists, so if you decide to start over from scratch,
git-am.sh
+10 -4
@@ -153,6 +153,7 @@ if test -d "$dotest"
153 then
154 test ",$#," = ",0," ||
155 die "previous dotest directory $dotest still exists but mbox given."
156 + resume=yes
157 else
158 # Make sure we are not given --skip
159 test ",$skip," = ,, ||
@@ -215,10 +216,15 @@ do
216 go_next
217 continue
218 }
218 - git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
219 - <"$dotest/$msgnum" >"$dotest/info" ||
220 - stop_here $this
221 - git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
219 + case "$resume" in
220 + '')
221 + git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
222 + <"$dotest/$msgnum" >"$dotest/info" ||
223 + stop_here $this
224 + git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
225 + ;;
226 + esac
227 + resume=
228
229 GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
230 GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"