Code

post-receive-email example hook: sed command for getting description was wrong
authorAndy Parkins <andyparkins@gmail.com>
Thu, 26 Apr 2007 21:37:16 +0000 (22:37 +0100)
committerJunio C Hamano <junkio@cox.net>
Fri, 27 Apr 2007 03:59:55 +0000 (20:59 -0700)
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/hooks/post-receive-email

index e175b426a406b39f36ecd11c0ff96adb41b263be..d1bef9125bca0997e0e714b3f89e9c2df307d598 100644 (file)
@@ -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