From 5d6491c7c7536ab930a6e9ce2ec3b5249d4c283f Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 2 Dec 2007 06:07:55 +0100 Subject: git-help: add -w|--web option to display html man page in a browser. Now when using "git help -w cmd", we will try to show the HTML man page "git-cmd.html" in your prefered web browser. To do that "help.c" code will call a new shell script "git-browse-help". This currently works only if the HTML versions of the man page have been installed in $(htmldir) (typically "/usr/share/doc/git-doc"), so new target to do that is added to "Documentation/Makefile". The browser to use can be configured using the "web.browser" config variable. We try to open a new tab in an existing web browser, if possible. The code in "git-browse-help" is heavily stolen from "git-mergetool" by Theodore Y. Ts'o. Thanks. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4b418bf76..932b0d434 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 @@ -223,7 +224,8 @@ SCRIPT_SH = \ git-merge-resolve.sh \ git-lost-found.sh git-quiltimport.sh git-submodule.sh \ git-filter-branch.sh \ - git-stash.sh + git-stash.sh \ + git-browse-help.sh SCRIPT_PERL = \ git-add--interactive.perl \ @@ -745,6 +747,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)) @@ -808,6 +811,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|@@HTMLDIR@@|$(htmldir_SQ)|g' \ $@.sh >$@+ && \ chmod +x $@+ && \ mv $@+ $@ -- cgit v1.2.1 From a149a1a44af45352b63e2dadd790616966c220be Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 10 Dec 2007 01:35:29 -0800 Subject: git-help -i: show info documentation from matching version of git Signed-off-by: Junio C Hamano --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 429bc1ddb..f20b8c009 100644 --- a/Makefile +++ b/Makefile @@ -155,6 +155,7 @@ STRIP ?= strip prefix = $(HOME) bindir = $(prefix)/bin mandir = $(prefix)/share/man +infodir = $(prefix)/share/info gitexecdir = $(bindir) sharedir = $(prefix)/share template_dir = $(sharedir)/git-core/templates @@ -750,6 +751,7 @@ ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) bindir_SQ = $(subst ','\'',$(bindir)) mandir_SQ = $(subst ','\'',$(mandir)) +infodir_SQ = $(subst ','\'',$(infodir)) gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) template_dir_SQ = $(subst ','\'',$(template_dir)) htmldir_SQ = $(subst ','\'',$(htmldir)) @@ -798,7 +800,9 @@ git$X: git.o $(BUILTIN_OBJS) $(GITLIBS) $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) help.o: help.c common-cmds.h GIT-CFLAGS - $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_MAN_PATH="$(mandir_SQ)"' $< + $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ + '-DGIT_MAN_PATH="$(mandir_SQ)"' \ + '-DGIT_INFO_PATH="$(infodir_SQ)"' $< git-merge-subtree$X: git-merge-recursive$X $(QUIET_BUILT_IN)$(RM) $@ && ln git-merge-recursive$X $@ -- cgit v1.2.1