tags 463336 + patch
thanks

Hello!

On Thu, 31 Jan 2008 00:19:04 +0100, Luca Capello wrote:
> BTW, as soon as the BTS will assign a bug number, I'll post the git
> patch.

Attached and also available on my git repository [1].

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://git.debian.org/?p=users/gismo/git.git;a=summary

From 57c345f2d0a6efd064ccd4525238202804713ad3 Mon Sep 17 00:00:00 2001
From: Luca Capello <[EMAIL PROTECTED]>
Date: Thu, 31 Jan 2008 00:25:53 +0100
Subject: [PATCH] contrib/hooks/post-receive-email: add hooks.projectname config option

If the project description is quite long, the email subject becomes
really long.  To avoid regressions, the project name defaults to the
project description.

Suggested through
 http://bugs.debian.org/463336

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 838472b..1104395 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -25,6 +25,8 @@
 #
 # Config
 # ------
+# hooks.projectname
+#   The name of the project (defaults to the project description).
 # hooks.projecturl
 #   The URL for the project: if set then it is inserted at the end of the
 #   commit email.
@@ -189,7 +191,7 @@ generate_email_header()
 	# Generate header
 	cat <<-EOF
 	To: $recipients
-	Subject: ${emailprefix}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe
+	Subject: ${emailprefix}$projectname $refname_type, $short_refname, ${change_type}d. $describe
 	X-Git-Refname: $refname
 	X-Git-Reftype: $refname_type
 	X-Git-Oldrev: $oldrev
@@ -628,6 +630,7 @@ then
 	projectdesc="UNNAMED PROJECT"
 fi
 
+projectname=$(git config hooks.projectname || echo "$projectdesc")
 projecturl=$(git config hooks.projecturl)
 recipients=$(git config hooks.mailinglist)
 announcerecipients=$(git config hooks.announcelist)
-- 
1.5.3.8

Attachment: pgp7xaCXOf9bJ.pgp
Description: PGP signature

Reply via email to