help -a: do not list commands that are excluded from the build
When built with NO_CURL or with NO_UNIX_SOCKETS, some commands are skipped from the build. It does not make sense to list them in the output of `git help -a`, so let's just not. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Apr 18, 2019 at 06:16 UTC
724d63569fe64944efd1c5a24455a0f578d33cba
2 files changed
+21
-3
Makefile
+12
-2
@@ -611,6 +611,7 @@ FUZZ_PROGRAMS =
611
LIB_OBJS =
612
PROGRAM_OBJS =
613
PROGRAMS =
614
+EXCLUDED_PROGRAMS =
615
SCRIPT_PERL =
616
SCRIPT_PYTHON =
617
SCRIPT_SH =
@@ -1319,6 +1320,7 @@ ifdef NO_CURL
1320
REMOTE_CURL_PRIMARY =
1321
REMOTE_CURL_ALIASES =
1322
REMOTE_CURL_NAMES =
1323
+ EXCLUDED_PROGRAMS += git-http-fetch git-http-push
1324
else
1325
ifdef CURLDIR
1326
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
@@ -1343,7 +1345,11 @@ endif
1345
ifeq "$(curl_check)" "070908"
1346
ifndef NO_EXPAT
1347
PROGRAM_OBJS += http-push.o
1348
+ else
1349
+ EXCLUDED_PROGRAMS += git-http-push
1350
endif
1351
+ else
1352
+ EXCLUDED_PROGRAMS += git-http-push
1353
endif
1354
curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1355
ifeq "$(curl_check)" "072200"
@@ -1589,7 +1595,9 @@ ifdef NO_INET_PTON
1595
LIB_OBJS += compat/inet_pton.o
1596
BASIC_CFLAGS += -DNO_INET_PTON
1597
endif
1592
-ifndef NO_UNIX_SOCKETS
1598
+ifdef NO_UNIX_SOCKETS
1599
+ EXCLUDED_PROGRAMS += git-credential-cache git-credential-cache--daemon
1600
+else
1601
LIB_OBJS += unix-socket.o
1602
PROGRAM_OBJS += credential-cache.o
1603
PROGRAM_OBJS += credential-cache--daemon.o
@@ -2108,7 +2116,9 @@ $(BUILT_INS): git$X
2116
command-list.h: generate-cmdlist.sh command-list.txt
2117
2118
command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt Documentation/config/*.txt
2111
- $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@
2119
+ $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
2120
+ $(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
2121
+ command-list.txt >$@+ && mv $@+ $@
2122
2123
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
2124
$(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
generate-cmdlist.sh
+9
-1
@@ -6,7 +6,7 @@ die () {
6
}
7
8
command_list () {
9
- grep -v '^#' "$1"
9
+ eval "grep -ve '^#' $exclude_programs" <"$1"
10
}
11
12
get_categories () {
@@ -93,6 +93,14 @@ EOF
93
EOF
94
}
95
96
+exclude_programs=
97
+while test "--exclude-program" = "$1"
98
+do
99
+ shift
100
+ exclude_programs="$exclude_programs -e \"^$1 \""
101
+ shift
102
+done
103
+
104
echo "/* Automatically generated by generate-cmdlist.sh */
105
struct cmdname_help {
106
const char *name;