summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e96f368)
raw | patch | inline | side by side (parent: e96f368)
author | Markus Heidelberg <markus.heidelberg@web.de> | |
Sun, 5 Apr 2009 02:15:16 +0000 (04:15 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 5 Apr 2009 06:57:59 +0000 (23:57 -0700) |
This can be used in GUIs to open installed HTML documentation in the
browser.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
browser.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 7513c57c6a3d4c6dfd853a48f438ee55b9244894..2ce5e6b451aaf3705d2aad2a64ce3e3e45827f83 100644 (file)
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
SYNOPSIS
--------
[verse]
-'git' [--version] [--exec-path[=GIT_EXEC_PATH]]
+'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
environment variable. If no path is given, 'git' will print
the current setting and then exit.
+--html-path::
+ Print the path to wherever your git HTML documentation is installed
+ and exit.
+
-p::
--paginate::
Pipe all output into 'less' (or if set, $PAGER).
diff --git a/Makefile b/Makefile
index 7867eaccdb90729aef26dc9f67a45a5a74961aae..bcf7cbb3fbcfa174dd3d26c95419caeb7dacc4b9 100644 (file)
--- a/Makefile
+++ b/Makefile
git.o: git.c common-cmds.h GIT-CFLAGS
$(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
+ '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
$(ALL_CFLAGS) -c $(filter %.c,$^)
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
index e72ce2428dd44176484ed88823dee6dd8707400c..fdc5a24b27c4df13d44d98da1dbbd4ade1178589 100755 (executable)
--bare
--version
--exec-path
+ --html-path
--work-tree=
--help
"
index c2b181ed78daa4510f5cfb7bbff5b78f449f872a..ff72e22bec3116b311a42e36dba6172b3390bfa2 100644 (file)
--- a/git.c
+++ b/git.c
#include "run-command.h"
const char git_usage_string[] =
- "git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]";
+ "git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]";
const char git_more_info_string[] =
"See 'git help COMMAND' for more information on a specific command.";
puts(git_exec_path());
exit(0);
}
+ } else if (!strcmp(cmd, "--html-path")) {
+ puts(system_path(GIT_HTML_PATH));
+ exit(0);
} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
use_pager = 1;
} else if (!strcmp(cmd, "--no-pager")) {
diff --git a/perl/Git.pm b/perl/Git.pm
index 7d7f2b1d367b505676032878615b2843eb64ed7b..291ff5b53c1883ee8fce67fbb7e2b32393ef0800 100644 (file)
--- a/perl/Git.pm
+++ b/perl/Git.pm
@EXPORT_OK = qw(command command_oneline command_noisy
command_output_pipe command_input_pipe command_close_pipe
command_bidi_pipe command_close_bidi_pipe
- version exec_path hash_object git_cmd_try
+ version exec_path html_path hash_object git_cmd_try
remote_refs
temp_acquire temp_release temp_reset temp_path);
sub exec_path { command_oneline('--exec-path') }
+=item html_path ()
+
+Return path to the Git html documentation (the same as
+C<git --html-path>). Useful mostly only internally.
+
+=cut
+
+sub html_path { command_oneline('--html-path') }
+
+
=item repo_path ()
Return path to the git repository. Must be called on a repository instance.