Skip to content

Commit faa7a09

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7c3bd71 commit faa7a09

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Documentation/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ mergetools-*.txt
1313
manpage-base-url.xsl
1414
SubmittingPatches.txt
1515
tmp-doc-diff/
16+
/GIT-EXCLUDED-PROGRAMS

Documentation/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ ARTICLES =
77
SP_ARTICLES =
88
OBSOLETE_HTML =
99

10+
-include GIT-EXCLUDED-PROGRAMS
11+
1012
MAN1_TXT += $(filter-out \
13+
$(patsubst %,%.txt,$(EXCLUDED_PROGRAMS)) \
1114
$(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
1215
$(wildcard git-*.txt))
1316
MAN1_TXT += git.txt

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,14 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS)
24512451

24522452
export DEFAULT_EDITOR DEFAULT_PAGER
24532453

2454+
Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
2455+
@EXCLUDED='EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)'; \
2456+
if test x"$$EXCLUDED" != \
2457+
x"`cat Documentation/GIT-EXCLUDED-PROGRAMS 2>/dev/null`" ; then \
2458+
echo >&2 " * new documentation flags"; \
2459+
echo "$$EXCLUDED" >Documentation/GIT-EXCLUDED-PROGRAMS; \
2460+
fi
2461+
24542462
.PHONY: doc man man-perl html info pdf
24552463
doc: man-perl
24562464
$(MAKE) -C Documentation all
@@ -3030,6 +3038,7 @@ clean: profile-clean coverage-clean cocciclean
30303038
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
30313039
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
30323040
$(MAKE) -C Documentation/ clean
3041+
$(RM) Documentation/GIT-EXCLUDED-PROGRAMS
30333042
ifndef NO_PERL
30343043
$(MAKE) -C gitweb clean
30353044
$(RM) -r perl/build/

0 commit comments

Comments
 (0)