Skip to contentSkip to conversation

Modify description file to say what this file is

PATCH In review John Tapsell 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 templates/hooks--update.sample |    5 +++--
 templates/this--description    |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
templates/hooks--update.sample +3 -2
index 93c6055..f753d28 100755
@@ -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
 
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a ref.
templates/this--description +1 -1
index c6f25e8..914a64e 100644
@@ -1 +1 @@
-Unnamed repository; edit this file to name it for gitweb.
+Unnamed repository; edit the .git/description file to name it for gitweb.
Signature · 1 line
1.6.2.rc1
#1 lore raw
Quoted 4 lines · John Tapsell

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.

Thanks.

Quoted 5 lines
templates/hooks--update.sample +0 -0
index 93c6055..f753d28 100755

templates/hooks--update.sample allowdeletetag=$(git config --bool hooks.allowdeletetag) · line 50

Quoted 10 lines
templates/hooks--update.sample +3 -2
@@ -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

templates/this--description line 1

Quoted 9 lines
templates/hooks--update.sample +0 -0
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a ref.
templates/this--description +1 -1
index c6f25e8..914a64e 100644
@@ -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."

#2 lore raw

2009/2/18 Junio C Hamano <[email protected]>:

Quoted 15 lines
Quoted 4 lines · John Tapsell

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.

Thanks.

Quoted 6 lines
templates/hooks--update.sample +0 -0
index 93c6055..f753d28 100755
@@ -43,10 +43,11 @@ allowdeletetag=$(git config --bool hooks.allowdeletetag)
 
Quoted 11 lines

templates/hooks--update.sample allowdeletetag=$(git config --bool hooks.allowdeletetag) · line 50

Quoted 9 lines
templates/hooks--update.sample +3 -2
 # 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,

Using case is a 'hack' to let me check if a string begins with another string, in a way that works in all shells (i.e. without bash manarisims)

Quoted 22 lines

but please start a case arm on a fresh line, like this:

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

templates/this--description line 1

Quoted 9 lines
templates/hooks--update.sample +0 -0
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a ref.
templates/this--description +1 -1
index c6f25e8..914a64e 100644
@@ -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.

Quoted 4 lines

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."

Btw, google seems to show other programs using the description file, not just gitweb. How about changing it to "Unnamed repository: edit the file 'description' to name the repository" ?

#3 lore raw
Quoted 5 lines · John Tapsell

2009/2/18 Junio C Hamano <[email protected]>:

Btw, google seems to show other programs using the description file, not just gitweb. How about changing it to "Unnamed repository: edit the file 'description' to name the repository" ?

Sure.

I also think "edit this file 'description' to name..." (not "the", but "this") would give a bit more hint to a user with a better intuition that the message is not something that is given by an individual program (e.g. gitweb or the sample hook) but is a product of catting a file that exists somewhere in the repository in question, and may reduce unnecessary requests for help saying "The program tells me to edit 'description' file, but where should I *create* one?"