1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-07 15:06:08 +02:00

docs: exclude documentation for commands that have been excluded

When building with certain build options, some commands are excluded
from the build. For example, `git-credential-cache` is skipped when
building with `NO_UNIX_SOCKETS`.

Let's not build or package documentation for those excluded commands.

This issue was pointed out rightfully when running `make check-docs` on
Windows, where we do not yet have Unix sockets, and therefore the
`credential-cache` command is excluded (yet its documentation was built
and shipped).

Note: building the documentation via `make -C Documentation` leaves the
build system with no way to determine which commands have been
excluded. If called thusly, we gracefully fail to exclude their
documentation. Only when building the documentation via the top-level
Makefile will it get excluded properly, or after building
`Documentation/GIT-EXCLUDED-PROGRAMS` manually.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin 2019-04-18 06:16:44 -07:00 committed by Junio C Hamano
parent 7c3bd713b1
commit faa7a096d8
3 changed files with 13 additions and 0 deletions

View File

@ -13,3 +13,4 @@ mergetools-*.txt
manpage-base-url.xsl
SubmittingPatches.txt
tmp-doc-diff/
/GIT-EXCLUDED-PROGRAMS

View File

@ -7,7 +7,10 @@ ARTICLES =
SP_ARTICLES =
OBSOLETE_HTML =
-include GIT-EXCLUDED-PROGRAMS
MAN1_TXT += $(filter-out \
$(patsubst %,%.txt,$(EXCLUDED_PROGRAMS)) \
$(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
$(wildcard git-*.txt))
MAN1_TXT += git.txt

View File

@ -2451,6 +2451,14 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS)
export DEFAULT_EDITOR DEFAULT_PAGER
Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
@EXCLUDED='EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)'; \
if test x"$$EXCLUDED" != \
x"`cat Documentation/GIT-EXCLUDED-PROGRAMS 2>/dev/null`" ; then \
echo >&2 " * new documentation flags"; \
echo "$$EXCLUDED" >Documentation/GIT-EXCLUDED-PROGRAMS; \
fi
.PHONY: doc man man-perl html info pdf
doc: man-perl
$(MAKE) -C Documentation all
@ -3030,6 +3038,7 @@ clean: profile-clean coverage-clean cocciclean
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
$(MAKE) -C Documentation/ clean
$(RM) Documentation/GIT-EXCLUDED-PROGRAMS
ifndef NO_PERL
$(MAKE) -C gitweb clean
$(RM) -r perl/build/