Subject: Re: [PATCH 1/2] Modify description file to say what this file is

From: Junio C Hamano <[email-masked]>
Date: Tue, 17 Feb 2009 10:39:12 -0800

John Tapsell <[email-masked]> writes:

> A lot of people see this message for the first time on the gitweb
> interface, where there is no clue as to what 'this file' means.
>
> Signed-off-by: John Tapsell <[email-masked]>

Thanks.

> diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
> index 93c6055..f753d28 100755
> --- a/templates/hooks--update.sample
> +++ b/templates/hooks--update.sample
> @@ -43,10 +43,11 @@ allowdeletetag=$(git config --bool hooks.allowdeletetag)
>  
>  # check for no description
>  projectdesc=$(sed -e '1q' "$GIT_DIR/description")
> -if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb." ]; then
> +case $projectdesc in "Unnamed repository;"*|'')
>  	echo "*** Project description file hasn't been set" >&2
>  	exit 1
> -fi
> +	;;
> +esac

"case" certainly makes it easier to read, but please start a case arm on a
fresh line, like this:

	case $projectdesc in
        "Unnamed repository;"* | '')
		echo "*** Project description ..."
		exit 1
		;;
	esac

>  # --- Check types
>  # if $newrev is 0000...0000, it's a commit to delete a ref.
> diff --git a/templates/this--description b/templates/this--description
> index c6f25e8..914a64e 100644
> --- a/templates/this--description
> +++ b/templates/this--description
> @@ -1 +1 @@
> -Unnamed repository; edit this file to name it for gitweb.
> +Unnamed repository; edit the .git/description file to name it for gitweb.

I do not have a fundamental objection to this line of changes.  If anybody
is relying on the exact wording so be it.

But ".git/description" is not typically the user has to edit to remedy
this situation, because the primary target for both gitweb and git-push is
a bare repository.  I think it is better to say "edit the 'description'
file to name it for gitweb."