git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] hooks/post-receive-email: do not truncate messages at a '.' line

From
Kyle J. McKay <mackyle@gmail.com>
Date
Jul 17, 2014, 19:26 UTC
Message-ID
<53b2ad7801889b49f04cb0ae7b0b37b@74d39fa044aa309eaea14b9f57fe79c>

When sendmail is reading an incoming message, by default it will terminate it if it reads a dot on a line by itself.

The post-receive-email script can generate such a line if the message in a tag object contains a dot ('.') on a line by itself.

There are two options to turn off this behavior, -i and -oi which are equivalent.

The choice of which to use is based on the observation that -i appears to be the more commonly used option for this and that all current sendmail-compatible programs appear to accept both.

Therefore add the -i option to the invocations of /usr/sbin/sendmail to avoid prematurely terminating the input message at the occurence of a dot ('.') on a line by itself.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
---
BTW, what is the status of post-receive-email?

I find it quite useful for a minimal server that only needs Git binaries and a POSIX shell.

The only real issue with it I'm aware of is that if multiple branch heads are updated in a single push and two or more contain the same new revison(s), those revision(s) will be incorrectly omitted from the emails sent out.

I have a patch to correct that, but it's not quite as simple as this patch and would need more review, so I don't really want to send it out and waste folks' time if there's no interest in picking up updates to contrib/hooks/post-receive-email.

 contrib/hooks/post-receive-email | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 8747b843..6207be60 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -704,9 +704,9 @@ limit_lines()
 send_mail()
 {
 	if [ -n "$envelopesender" ]; then
-		/usr/sbin/sendmail -t -f "$envelopesender"
+		/usr/sbin/sendmail -i -t -f "$envelopesender"
 	else
-		/usr/sbin/sendmail -t
+		/usr/sbin/sendmail -i -t
 	fi
 }
 
-- 
1.8.5
Next: Junio C Hamano
Message 1 of 2 in “hooks/post-receive-email: do not truncate messages at a '.' line”
  1. hooks/post-receive-email: do not truncate messages at a '.' lineKyle J. McKay, Jul 17, 2014
  2. Junio C HamanoJul 17, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.