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

Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 6, 2007, 17:03 UTC
Message-ID
<7v3aufeowe.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071202060755.4d6d5ec8.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 12 quoted lines
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index d886641..3e01718 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -29,6 +29,7 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
>  
>  prefix?=$(HOME)
>  bindir?=$(prefix)/bin
> +htmldir?=$(prefix)/share/doc/git-doc
>  mandir?=$(prefix)/share/man
>  man1dir=$(mandir)/man1
>  man5dir=$(mandir)/man5
Doing this and then ...
Show 32 quoted lines
> diff --git a/Makefile b/Makefile
> index a5a40ce..9204bfe 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -807,6 +808,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
>  	    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
>  	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
>  	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
> +	    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \
>  	    $@.sh >$@+ && \
>  	chmod +x $@+ && \
>  	mv $@+ $@
> ...
> diff --git a/git-browse-help.sh b/git-browse-help.sh
> new file mode 100755
> index 0000000..11f8bfa
> --- /dev/null
> +++ b/git-browse-help.sh
> @@ -0,0 +1,154 @@
> +#!/bin/sh
> ...
> +USAGE='[--browser=browser|--tool=browser] [cmd to display] ...'
> +SUBDIRECTORY_OK=Yes
> +OPTIONS_SPEC=
> +. git-sh-setup
> +
> +PREFIX="@@PREFIX@@"
> +GIT_VERSION="@@GIT_VERSION@@"
> +
> +# Directories that may contain html documentation:
> +install_html_dir="$PREFIX/share/doc/git-doc"
> +rpm_dir="$PREFIX/share/doc/git-core-$GIT_VERSION"

... doing this is wrong. 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.

> +init_browser_path() {
> +	browser_path=`git config browser.$1.path`
> +	test -z "$browser_path" && browser_path=$1
> +}

Please do not contaminate the config file with something the user can easily use a lot more standardized way (iow $PATH) to configure to his taste.

I'd suggest dropping this bit.
Previous: Christian CouderNext: Christian Couder
Message 2 of 8 in “git-help: add -w|--web option to display html man page in a browser.”
  1. 2/3 git-help: add -w|--web option to display html man page in a browser.Christian Couder, Dec 2, 2007
  2. Junio C HamanoDec 6, 2007
  3. Christian CouderDec 7, 2007
  4. Junio C HamanoDec 7, 2007
  5. Junio C HamanoDec 7, 2007
  6. Christian CouderDec 8, 2007
  7. Junio C HamanoDec 6, 2007
  8. Junio C HamanoDec 8, 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.