Permalink
Browse files

Modify description file to say what this file is

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 <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information...
1 parent 9f199b1 commit 28001d0873cfce1ad6a44f1c2deaf9388d953cc3 @johnflux johnflux committed with gitster Feb 19, 2009
Showing with 5 additions and 3 deletions.
  1. +4 −2 templates/hooks--update.sample
  2. +1 −1 templates/this--description
@@ -43,10 +43,12 @@ 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
# --- Check types
# if $newrev is 0000...0000, it's a commit to delete a ref.
@@ -1 +1 @@
-Unnamed repository; edit this file to name it for gitweb.
+Unnamed repository; edit this file 'description' to name the repository.

2 comments on commit 28001d0

@ciremunahpla

@@ -43,10 +43,12 @@ allowdeletetag=$(git config --bool hooks.allowdeletetag)

check for no description

projectdesc=$(sed -e '1q' "$GIT_DIR/description")
-if [ -z "$projectdesc" -o "$projectdesc" = "The Repository"]; then
+case "$projectdesc" in
+"The Repository"* | "")
echo "*** Set project description file has been set" >&2
exit 1
-fi

  • ;;
    +esac

--- Check types

if $newrev is 0000...0000, it's a commit to delete a ref.

@ciremunahpla

@@ -43,10 +43,12 @@ allowdeletetag=$(git config --bool hooks.allowdeletetag)

check for no description

projectdesc=$(sed -e '1q' "$GIT_DIR/description")
-if [ -z "$projectdesc" -o "$projectdesc" = "The Repository"]; then
+case "$projectdesc" in
+"The Repository"* | "")
echo "*** Set project description file has been set" >&2
exit 1
-fi

  • ;;
    +esac

if $newrev is 0000...0000, it's a commit to delete a ref.

if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
newrev_type=delete
else
newrev_type=$(git-cat-file -t $newrev)
fi

case "$refname","$newrev_type" in
refs/tags/,commit)
# un-annotated tag
short_refname=${refname##refs/tags/}
if [ "$allowunannotated" != "true" ]; then
echo "
* The un-annotated tag, $short_refname, is not allowed in this repository" >&2
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
exit 1
fi
;;
refs/tags/,delete)
# delete tag
if [ "$allowdeletetag" != "true" ]; then
echo "
* Deleting a tag is not allowed in this repository" >&2
exit 1
fi
;;
refs/tags/,tag)
# annotated tag
;;
refs/heads/
,commit)
# branch
;;
refs/heads/,delete)
# delete branch
if [ "$allowdeletebranch" != "true" ]; then
echo "
* Deleting a branch is not allowed in this repository" >&2
exit 1
fi
;;
refs/remotes/,commit)
# tracking branch
;;
refs/remotes/
,delete)
# delete tracking branch
if [ "$allowdeletebranch" != "true" ]; then
echo "*** Deleting a tracking branch is not allowed in this repository" >&2
exit 1
fi
;;
)
# Anything else (is there anything else?)
echo "
* Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
exit 1
;;
esac

--- Finished

exit 0

Please sign in to comment.