threads / discuss / 11170

Re: git-am: catch missing author date early.

Subject: Re: git-am: catch missing author date early.

## tl;dr

2 messages between Dec 7, 2007 and Dec 7, 2007.

replies: 1people: 2as markdown or json

Len Brown· Dec 7, 2007, 02:34 UTC · lore
This change made git-am more difficult to use.

I tend to check-in a fair number of patches that didn't come from an e-mail message. In the past, I slap a Subject: and a From: on the top of the commit message and off I go.

With this change git-am fails b/c I haven't also conjured up the time, when in the past it figured out what time it was for me.

thanks, -Len

commit 6e9e0327b7d7f384d8a223b4bc40330ef3e7fb61
Author: Junio C Hamano <gitster@pobox.com>
Date:   Sun Dec 2 14:38:40 2007 -0800
    git-am: catch missing author date early.
    
    Even though commit-tree would default to the current time if the incoming
    e-mail message somehow did not record the timestamp, it is safer to catch
    the breakage sooner.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/git-am.sh b/git-am.sh
index 76c1c84..2e40708 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -307,9 +307,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"
+	if test -z "$GIT_AUTHOR_EMAIL" || test -z "$GIT_AUTHOR_DATE"
 	then
-		echo "Patch does not have a valid e-mail address."
+		echo "Patch does not have valid authorship information."
 		stop_here $this
 	fi
 

← back to recent threads