mirror of
https://github.com/git/git.git
synced 2024-05-19 17:36:08 +02:00
Merge branch 'vr/help-per-platform'
We used to always default to "man" format even on platforms where "man" viewer is not widely available. * vr/help-per-platform: help: use HTML as the default help format on Windows
This commit is contained in:
commit
a88d7aaee8
9
Makefile
9
Makefile
|
@ -299,6 +299,10 @@ all::
|
||||||
#
|
#
|
||||||
# Define GIT_USER_AGENT if you want to change how git identifies itself during
|
# Define GIT_USER_AGENT if you want to change how git identifies itself during
|
||||||
# network interactions. The default is "git/$(GIT_VERSION)".
|
# network interactions. The default is "git/$(GIT_VERSION)".
|
||||||
|
#
|
||||||
|
# Define DEFAULT_HELP_FORMAT to "man", "info" or "html"
|
||||||
|
# (defaults to "man") if you want to have a different default when
|
||||||
|
# "git help" is called without a parameter specifying the format.
|
||||||
|
|
||||||
GIT-VERSION-FILE: FORCE
|
GIT-VERSION-FILE: FORCE
|
||||||
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
||||||
|
@ -1242,6 +1246,7 @@ ifeq ($(uname_S),Windows)
|
||||||
BLK_SHA1 = YesPlease
|
BLK_SHA1 = YesPlease
|
||||||
NO_POSIX_GOODIES = UnfortunatelyYes
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
||||||
NATIVE_CRLF = YesPlease
|
NATIVE_CRLF = YesPlease
|
||||||
|
DEFAULT_HELP_FORMAT = html
|
||||||
|
|
||||||
CC = compat/vcbuild/scripts/clink.pl
|
CC = compat/vcbuild/scripts/clink.pl
|
||||||
AR = compat/vcbuild/scripts/lib.pl
|
AR = compat/vcbuild/scripts/lib.pl
|
||||||
|
@ -1926,6 +1931,10 @@ GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))"
|
||||||
GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ))
|
GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ))
|
||||||
BASIC_CFLAGS += -DGIT_USER_AGENT='$(GIT_USER_AGENT_CQ_SQ)'
|
BASIC_CFLAGS += -DGIT_USER_AGENT='$(GIT_USER_AGENT_CQ_SQ)'
|
||||||
|
|
||||||
|
ifdef DEFAULT_HELP_FORMAT
|
||||||
|
BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'
|
||||||
|
endif
|
||||||
|
|
||||||
ALL_CFLAGS += $(BASIC_CFLAGS)
|
ALL_CFLAGS += $(BASIC_CFLAGS)
|
||||||
ALL_LDFLAGS += $(BASIC_LDFLAGS)
|
ALL_LDFLAGS += $(BASIC_LDFLAGS)
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
#include "column.h"
|
#include "column.h"
|
||||||
#include "help.h"
|
#include "help.h"
|
||||||
|
|
||||||
|
#ifndef DEFAULT_HELP_FORMAT
|
||||||
|
#define DEFAULT_HELP_FORMAT "man"
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct man_viewer_list {
|
static struct man_viewer_list {
|
||||||
struct man_viewer_list *next;
|
struct man_viewer_list *next;
|
||||||
char name[FLEX_ARRAY];
|
char name[FLEX_ARRAY];
|
||||||
|
@ -445,7 +449,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
|
||||||
setup_git_directory_gently(&nongit);
|
setup_git_directory_gently(&nongit);
|
||||||
git_config(git_help_config, NULL);
|
git_config(git_help_config, NULL);
|
||||||
|
|
||||||
if (parsed_help_format != HELP_FORMAT_NONE)
|
if (parsed_help_format == HELP_FORMAT_NONE)
|
||||||
|
help_format = parse_help_format(DEFAULT_HELP_FORMAT);
|
||||||
|
else
|
||||||
help_format = parsed_help_format;
|
help_format = parsed_help_format;
|
||||||
|
|
||||||
alias = alias_lookup(argv[0]);
|
alias = alias_lookup(argv[0]);
|
||||||
|
|
Loading…
Reference in New Issue