diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-12 17:46:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-12 17:46:16 -0800 |
commit | 467f42cfa1d298dcaab40e06f8dfa8f80ee345f7 (patch) | |
tree | 8f8e4f458b0a74e2f827eaf746d26c008037bb67 /Documentation | |
parent | Merge branch 'jc/shortlog-e' (diff) | |
parent | RPM spec: Adjust htmldir (diff) | |
download | tgif-467f42cfa1d298dcaab40e06f8dfa8f80ee345f7.tar.xz |
Merge branch 'cc/help'
* cc/help:
RPM spec: Adjust htmldir
git-help -w: do not require to be in git repository
git.spec.in: remove python_path
Documentation: rename git.texi to user-manual.texi
Add git-browse-help to .gitignore
git-help -i: show info documentation from matching version of git
git-help -i: invoke info with document and node name
Documentation: add gitman.info target
Documentation: describe -w/--web option to "git-help".
Use {web,instaweb,help}.browser config options.
git-help: add -w|--web option to display html man page in a browser.
Documentation: describe -i/--info option to "git-help"
git-help: add -i|--info option to display info page.
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/Makefile | 40 | ||||
-rwxr-xr-x | Documentation/cat-texi.perl | 38 | ||||
-rw-r--r-- | Documentation/git-help.txt | 28 | ||||
-rw-r--r-- | Documentation/git-instaweb.txt | 3 | ||||
-rw-r--r-- | Documentation/git.txt | 5 |
5 files changed, 103 insertions, 11 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile index 1b5802456d..1fd48ab367 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -5,7 +5,11 @@ MAN1_TXT= \ MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt MAN7_TXT=git.txt -DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)) +MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT) +MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) +MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) + +DOC_HTML=$(MAN_HTML) ARTICLES = tutorial ARTICLES += tutorial-2 @@ -29,6 +33,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 @@ -79,7 +84,7 @@ man1: $(DOC_MAN1) man5: $(DOC_MAN5) man7: $(DOC_MAN7) -info: git.info +info: git.info gitman.info install: man $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) @@ -91,13 +96,17 @@ install: man install-info: info $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) - $(INSTALL) -m 644 git.info $(DESTDIR)$(infodir) + $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir) if test -r $(DESTDIR)$(infodir)/dir; then \ $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\ + $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\ else \ echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \ fi +install-html: html + sh ./install-webdoc.sh $(DESTDIR)$(htmldir) + ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE $(MAKE) -C ../ GIT-VERSION-FILE @@ -161,12 +170,27 @@ XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css user-manual.html: user-manual.xml xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< -git.info: user-manual.xml - $(RM) $@ $*.texi $*.texi+ - $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+ - $(PERL_PATH) fix-texi.perl <$*.texi+ >$*.texi +git.info: user-manual.texi + $(MAKEINFO) --no-split -o $@ user-manual.texi + +user-manual.texi: user-manual.xml + $(RM) $@+ $@ + $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+ + mv $@+ $@ + +gitman.texi: $(MAN_XML) cat-texi.perl + $(RM) $@+ $@ + ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \ + $(PERL_PATH) cat-texi.perl $@ >$@+ + mv $@+ $@ + +gitman.info: gitman.texi $(MAKEINFO) --no-split $*.texi - $(RM) $*.texi $*.texi+ + +$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml + $(RM) $@+ $@ + $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ + mv $@+ $@ howto-index.txt: howto-index.sh $(wildcard howto/*.txt) $(RM) $@+ $@ diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl new file mode 100755 index 0000000000..e3d8e9faa8 --- /dev/null +++ b/Documentation/cat-texi.perl @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w + +my @menu = (); +my $output = $ARGV[0]; + +open TMP, '>', "$output.tmp"; + +while (<STDIN>) { + next if (/^\\input texinfo/../\@node Top/); + next if (/^\@bye/ || /^\.ft/); + if (s/^\@top (.*)/\@node $1,,,Top/) { + push @menu, $1; + } + s/\(\@pxref{\[URLS\]}\)//; + print TMP; +} +close TMP; + +printf '\input texinfo +@setfilename gitman.info +@documentencoding us-ascii +@node Top,,%s +@top Git Manual Pages +@documentlanguage en +@menu +', $menu[0]; + +for (@menu) { + print "* ${_}::\n"; +} +print "\@end menu\n"; +open TMP, '<', "$output.tmp"; +while (<TMP>) { + print; +} +close TMP; +print "\@bye\n"; +unlink "$output.tmp"; diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt index 7ddbf467df..ac9e15d774 100644 --- a/Documentation/git-help.txt +++ b/Documentation/git-help.txt @@ -7,7 +7,7 @@ git-help - display help information about git SYNOPSIS -------- -'git help' [-a|--all] [COMMAND] +'git help' [-a|--all|-i|--info|-w|--web] [COMMAND] DESCRIPTION ----------- @@ -20,7 +20,8 @@ If the option '--all' or '-a' is given, then all available commands are printed on the standard output. If a git command is named, a manual page for that command is brought -up. The 'man' program is used by default for this purpose. +up. The 'man' program is used by default for this purpose, but this +can be overriden by other options. Note that 'git --help ...' is identical as 'git help ...' because the former is internally converted into the latter. @@ -28,10 +29,31 @@ former is internally converted into the latter. OPTIONS ------- -a|--all:: - Prints all the available commands on the standard output. This option superseeds any other option. +-i|--info:: + Use the 'info' program to display the manual page, instead of + the 'man' program that is used by default. + +-w|--web:: + Use a web browser to display the HTML manual page, instead of + the 'man' program that is used by default. ++ +The web browser can be specified using the configuration variable +'help.browser', or 'web.browser' if the former is not set. If none of +these config variables is set, the 'git-browse-help' script (called by +'git-help') will pick a suitable default. ++ +You can explicitly provide a full path to your prefered browser by +setting the configuration variable 'browser.<tool>.path'. For example, +you can configure the absolute path to firefox by setting +'browser.firefox.path'. Otherwise, 'git-browse-help' assumes the tool +is available in PATH. ++ +Note that the script tries, as much as possible, to display the HTML +page in a new tab on an already opened browser. + Author ------ Written by Junio C Hamano <gitster@pobox.com> and the git-list diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt index 735008c1ab..d2ce7790e6 100644 --- a/Documentation/git-instaweb.txt +++ b/Documentation/git-instaweb.txt @@ -71,6 +71,9 @@ You may specify configuration in your .git/config ----------------------------------------------------------------------- +If the configuration variable 'instaweb.browser' is not set, +'web.browser' will be used instead if it is defined. + Author ------ Written by Eric Wong <normalperson@yhbt.net> diff --git a/Documentation/git.txt b/Documentation/git.txt index 1574ecd77e..a29b634e7a 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -104,6 +104,11 @@ OPTIONS commands. If the option '--all' or '-a' is given then all available commands are printed. If a git command is named this option will bring up the manual page for that command. ++ +Other options are available to control how the manual page is +displayed. See gitlink:git-help[1] for more information, +because 'git --help ...' is converted internally into 'git +help ...'. --exec-path:: Path to wherever your core git programs are installed. |