Code

update-hook: abort early if the project description is unset
authorAndy Parkins <andyparkins@gmail.com>
Tue, 20 Mar 2007 10:58:32 +0000 (10:58 +0000)
committerJunio C Hamano <junkio@cox.net>
Thu, 22 Mar 2007 10:02:31 +0000 (03:02 -0700)
It was annoying to always have the first email from a project be from
the "Unnamed repository; edit this file to name it for gitweb project";
just because it's so easy to forget to set it.

This patch checks to see if the description file is still default (or
empty) and aborts if so - allowing you to fix the problem before sending
out silly looking emails to every developer.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
templates/hooks--update

index 8f6c4fea2429cef0da4748f8871ceaed94b432cc..1a60773890cfcbaa5727636e6eda8280feb23bc1 100644 (file)
@@ -56,6 +56,12 @@ recipients=$(git-repo-config hooks.mailinglist)
 announcerecipients=$(git-repo-config hooks.announcelist)
 allowunannotated=$(git-repo-config --bool hooks.allowunannotated)
 
+# check for no description
+if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb" ]; then
+       echo "*** Project description file hasn't been set" >&2
+       exit 1
+fi
+
 # --- Check types
 newrev_type=$(git-cat-file -t $newrev)