Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-am: do not lose already edited final-commit when resuming.
author
Junio C Hamano
<junkio@cox.net>
Tue, 8 Nov 2005 08:41:37 +0000
(
00:41
-0800)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 8 Nov 2005 09:23:53 +0000
(
01:23
-0800)
The last round stopped munging the patch when resuming, but
failed to preserve final-commit.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-am.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
39b4ac9
)
diff --git
a/git-am.sh
b/git-am.sh
index 115ebaddf595f49059208ac890308b6ebe01aa42..38841d9beec8b718bf0ef4d2b98078783061b57a 100755
(executable)
--- a/
git-am.sh
+++ b/
git-am.sh
@@
-224,29
+224,33
@@
do
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
;;
esac
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")"
GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
- SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
- if test '' != "$SIGNOFF"
- then
+
+ case "$resume" in
+ '')
+ if test '' != "$SIGNOFF"
+ then
LAST_SIGNED_OFF_BY=`
LAST_SIGNED_OFF_BY=`
- sed -ne '/^Signed-off-by: /p' "$dotest/msg-clean" |
- tail -n 1
+ sed -ne '/^Signed-off-by: /p' \
+ "$dotest/msg-clean" |
+ tail -n 1
`
`
- ADD_SIGNOFF=$(test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
+ ADD_SIGNOFF=`
+ test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
test '' = "$LAST_SIGNED_OFF_BY" && echo
echo "$SIGNOFF"
test '' = "$LAST_SIGNED_OFF_BY" && echo
echo "$SIGNOFF"
- }
)
- else
+ }
`
+
else
ADD_SIGNOFF=
ADD_SIGNOFF=
- fi
- {
+
fi
+
{
echo "$SUBJECT"
if test -s "$dotest/msg-clean"
then
echo "$SUBJECT"
if test -s "$dotest/msg-clean"
then
@@
-257,8
+261,11
@@
do
then
echo "$ADD_SIGNOFF"
fi
then
echo "$ADD_SIGNOFF"
fi
- } >"$dotest/final-commit"
+ } >"$dotest/final-commit"
+ ;;
+ esac
+ resume=
if test "$interactive" = t
then
test -t 0 ||
if test "$interactive" = t
then
test -t 0 ||