Skip to contentSkip to conversation

post-receive-email example hook: sed command for getting description was wrong

PATCH Andy Parkins 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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.

---
Oops - patch 3 in my series of 2. Tee hee.

 contrib/hooks/post-receive-email |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/hooks/post-receive-email +1 -1
index e175b42..d1bef91 100644
@@ -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
Signature · 1 line
1.5.2.rc0.744.g33910