git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-help: fix looking up html install dir when browsing.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Dec 7, 2007, 05:29 UTC
Message-ID
<20071207062923.6663a7d1.chriscool@tuxfamily.org>
We used to search for the following directories:
	- $PREFIX/share/doc/git-doc
	- $PREFIX/share/doc/git-core-$GIT_VERSION

This was wrong because "htmldir" could be defined in the Makefiles to something completely different.

So we now look for the $htlmdir directory first. But if it fails we still fall back to the two above directories, in case the script install and the html doc install have been done with different $htmldir.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Makefile           |    5 ++++-
 git-browse-help.sh |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)
	Junio wrote:
	> People can set htmldir to somewhere other than
	> $(prefix)/share/doc/git-doc while building and
	> installing, but you are not telling the munged
	> script where it is.
	This should fix it.
	Thanks.
diff --git a/Makefile b/Makefile
index e9a119a..1e31f02 100644
--- a/Makefile
+++ b/Makefile
@@ -157,6 +157,7 @@ bindir = $(prefix)/bin
 gitexecdir = $(bindir)
 sharedir = $(prefix)/share
 template_dir = $(sharedir)/git-core/templates
+htmldir=$(sharedir)/doc/git-doc
 ifeq ($(prefix),/usr)
 sysconfdir = /etc
 else
@@ -183,7 +184,7 @@ GITWEB_FAVICON = git-favicon.png
 GITWEB_SITE_HEADER =
 GITWEB_SITE_FOOTER =
 
-export prefix bindir gitexecdir sharedir template_dir sysconfdir
+export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
 
 CC = gcc
 AR = ar
@@ -747,6 +748,7 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
+htmldir_SQ = $(subst ','\'',$(htmldir))
 prefix_SQ = $(subst ','\'',$(prefix))
 
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -811,6 +813,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \
+	    -e 's|@@HTMLDIR@@|$(htmldir_SQ)|g' \
 	    $@.sh >$@+ && \
 	chmod +x $@+ && \
 	mv $@+ $@
diff --git a/git-browse-help.sh b/git-browse-help.sh
index 11f8bfa..12d313a 100755
--- a/git-browse-help.sh
+++ b/git-browse-help.sh
@@ -21,6 +21,8 @@ SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
 . git-sh-setup
 
+# Install data.
+special_html_dir="@@HTMLDIR@@"
 PREFIX="@@PREFIX@@"
 GIT_VERSION="@@GIT_VERSION@@"
 
@@ -30,7 +32,7 @@ rpm_dir="$PREFIX/share/doc/git-core-$GIT_VERSION"
 
 # Look for the directory that really contains html documentation.
 html_dir=''
-for dir in "$install_html_dir" "$rpm_dir"
+for dir in "$special_html_dir" "$install_html_dir" "$rpm_dir"
 do
 	test -d "$dir" && { html_dir="$dir" ; break ; }
 done
-- 
1.5.3.6.1993.g154f-dirty
Message 1 of 1 in “git-help: fix looking up html install dir when browsing.”
  1. git-help: fix looking up html install dir when browsing.Christian Couder, Dec 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.