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

[PATCH 3/2] post-receive-email example hook: sed command for getting description was wrong

From
APAndy Parkins <andyparkins@gmail.com>
Date
Apr 26, 2007, 21:37 UTC
Message-ID
<200704262237.16795.andyparkins@gmail.com>

The sed command that extracted the first line of the project description didn't include the -n switch and hence the project name was being printed twice. This was ruining the email header generation because it was assumed that the description was only one line and was included in the subject. This turned the subject into a two line item and prematurely finished the header.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
Oops - patch 3 in my series of 2.  Tee hee.
 contrib/hooks/post-receive-email |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index e175b42..d1bef91 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -587,7 +587,7 @@ if [ -z "$GIT_DIR" ]; then
 	exit 1
 fi
 
-projectdesc=$(sed -e '1p' "$GIT_DIR/description")
+projectdesc=$(sed -ne '1p' "$GIT_DIR/description")
 # Check if the description is unchanged from it's default, and shorten it to a
 # more manageable length if it is
 if expr "$projectdesc" : "Unnamed repository.*$" >/dev/null
-- 
1.5.2.rc0.744.g33910
Message 1 of 1 in “post-receive-email example hook: sed command for getting description was wrong”
  1. 3/2 post-receive-email example hook: sed command for getting description was wrongAndy Parkins, Apr 26, 2007

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.