]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
Makefile: customization for supporting HP-UX
[git.git] / git-am.sh
index 2e407084260350e7fa56987a7603afdcd00acfb5..5f0f241ad0bb53960d5969df5445760633f87dbc 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -117,6 +117,10 @@ It does not apply to blobs recorded in its index."
     unset GITHEAD_$his_tree
 }
 
+reread_subject () {
+       git stripspace <"$1" | sed -e 1q
+}
+
 prec=4
 dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary=
 resolvemsg= resume=
@@ -307,9 +311,9 @@ do
        GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
        GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
 
-       if test -z "$GIT_AUTHOR_EMAIL" || test -z "$GIT_AUTHOR_DATE"
+       if test -z "$GIT_AUTHOR_EMAIL"
        then
-               echo "Patch does not have valid authorship information."
+               echo "Patch does not have a valid e-mail address."
                stop_here $this
        fi
 
@@ -376,6 +380,7 @@ do
                [aA]*) action=yes interactive= ;;
                [nN]*) action=skip ;;
                [eE]*) git_editor "$dotest/final-commit"
+                      SUBJECT=$(reread_subject "$dotest/final-commit")
                       action=again ;;
                [vV]*) action=again
                       LESS=-S ${PAGER:-less} "$dotest/patch" ;;
@@ -464,9 +469,9 @@ do
                "$GIT_DIR"/hooks/post-applypatch
        fi
 
-       git gc --auto
-
        go_next
 done
 
+git gc --auto
+
 rm -fr "$dotest"