Subject: Re: [PATCH] contrib/hooks/post-receive-email: checks for gitweb.description

From: Jakub Narebski <[email-masked]>
Date: Mon, 11 Feb 2008 13:20:21 -0800 (PST)

Bruno Ribas <[email-masked]> writes:

Here it would be nice to have longer description, like:

  Check repository configuration gitweb.description for project
  description, if $GIT_DIR/description does not exist

Note that 'description' file is created by default when creating
repository by git-init by default repo template.

> Signed-off-by: Bruno Ribas <[email-masked]>
> ---
>  contrib/hooks/post-receive-email |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
> index 77c88eb..bdd21fa 100644
> --- a/contrib/hooks/post-receive-email
> +++ b/contrib/hooks/post-receive-email
> @@ -614,7 +614,11 @@ if [ -z "$GIT_DIR" ]; then
>  	exit 1
>  fi
>  
> -projectdesc=$(sed -ne '1p' "$GIT_DIR/description")
> +if [ -f "$GIT_DIR/description" ]; then
> +	projectdesc=$(sed -ne '1p' "$GIT_DIR/description")
> +else
> +	projectdesc=$(git-config gitweb.description)

The rest of this hook use "git cmd". Preferred way to call git
commands is "git cmd". So I would use

  "git config gitweb.description"

> +fi
>  # 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.4.24.gce08d
> 

-- 
Jakub Narebski
Poland
ShadeHawk on #git