Message ID | 31d8e43cbfaec36f662006a711b64bca47009e59.1555070430.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Assorted Documentation-related fixes | expand |
On Fri, Apr 12, 2019 at 8:00 AM Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com> wrote: > 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. > [...] > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > diff --git a/Makefile b/Makefile > @@ -2455,22 +2455,25 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS) > +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname > + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ Should this rule also have a dependency upon "config.mak.autogen"? Perhaps like this: Documentation/GIT-EXCLUDED-PROGRAMS: Makefile $(wildcard config.mak*)
Eric Sunshine <sunshine@sunshineco.com> writes: >> diff --git a/Makefile b/Makefile >> @@ -2455,22 +2455,25 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS) >> +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname >> + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ > > Should this rule also have a dependency upon "config.mak.autogen"? That is probably a good point. > Perhaps like this: > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile $(wildcard config.mak*) I'd rather not let changes to "config.mak-", which I keep in my working tree (untracked and disabled copy of config.mak, that can be readily activated by renaming), be part of dependency rules. If we know 'autogen' is the only dependency that optionally can exist, then depending explicitly on $(wildcard config.mak.autogen) would be a better alternative. To those who do not use the autoconf, the macro will expand to an empty string, and to those who do have the path on the filesystem, the macro parrots the constant string it was given, which is exactly what we want. Thanks.
On Sun, Apr 14, 2019 at 11:10 PM Junio C Hamano <gitster@pobox.com> wrote: > Eric Sunshine <sunshine@sunshineco.com> writes: > >> +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname > >> + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ > > > > Should this rule also have a dependency upon "config.mak.autogen"? > > That is probably a good point. > > > Perhaps like this: > > > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile $(wildcard config.mak*) > > I'd rather not let changes to "config.mak-", which I keep in my > working tree (untracked and disabled copy of config.mak, that can be > readily activated by renaming), be part of dependency rules. > > If we know 'autogen' is the only dependency that optionally can > exist, then depending explicitly on $(wildcard config.mak.autogen) > would be a better alternative. When composing that email, I originally wrote $(wildcard config.mak.autogen) as the suggestion but changed it to the looser $(wildcard config.mak*) when I realized that the developer's own config.mak probably ought to be a dependency, as well. Taking your objection into consideration, we could mention both explicitly: Documentation/GIT-EXCLUDED-PROGRAMS: Makefile \ $(wildcard config.mak) $(wildcard config.mak.autogen)
On Mon, Apr 15, 2019 at 12:16 AM Eric Sunshine <sunshine@sunshineco.com> wrote: > When composing that email, I originally wrote $(wildcard > config.mak.autogen) as the suggestion but changed it to the looser > $(wildcard config.mak*) when I realized that the developer's own > config.mak probably ought to be a dependency, as well. Taking your > objection into consideration, we could mention both explicitly: > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile \ > $(wildcard config.mak) $(wildcard config.mak.autogen) Bleh, I forgot config.mak.uname from Dscho's original patch. Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname \ $(wildcard config.mak) $(wildcard config.mak.autogen)
On Mon, Apr 15, 2019 at 12:16:51AM -0400, Eric Sunshine wrote: > On Sun, Apr 14, 2019 at 11:10 PM Junio C Hamano <gitster@pobox.com> wrote: > > Eric Sunshine <sunshine@sunshineco.com> writes: > > >> +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname > > >> + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ > > > > > > Should this rule also have a dependency upon "config.mak.autogen"? > > > > That is probably a good point. > > > > > Perhaps like this: > > > > > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile $(wildcard config.mak*) > > > > I'd rather not let changes to "config.mak-", which I keep in my > > working tree (untracked and disabled copy of config.mak, that can be > > readily activated by renaming), be part of dependency rules. > > > > If we know 'autogen' is the only dependency that optionally can > > exist, then depending explicitly on $(wildcard config.mak.autogen) > > would be a better alternative. > > When composing that email, I originally wrote $(wildcard > config.mak.autogen) as the suggestion but changed it to the looser > $(wildcard config.mak*) when I realized that the developer's own > config.mak probably ought to be a dependency, as well. Taking your > objection into consideration, we could mention both explicitly: > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile \ > $(wildcard config.mak) $(wildcard config.mak.autogen) What about command-line options that influence the outcome? It sounds like this is the same problem we have in lots of other places (like say, compiler flags being updated), that we solve by generating the proposed file output unconditionally and comparing it to what's on disk. E.g., see the way GIT-CFLAGS or GIT-BUILD-OPTIONS is generated. -Peff
Jeff King <peff@peff.net> writes: > What about command-line options that influence the outcome? It sounds > like this is the same problem we have in lots of other places (like say, > compiler flags being updated), that we solve by generating the proposed > file output unconditionally and comparing it to what's on disk. E.g., > see the way GIT-CFLAGS or GIT-BUILD-OPTIONS is generated. ;-).
Hi Peff, On Mon, 15 Apr 2019, Jeff King wrote: > On Mon, Apr 15, 2019 at 12:16:51AM -0400, Eric Sunshine wrote: > > > On Sun, Apr 14, 2019 at 11:10 PM Junio C Hamano <gitster@pobox.com> wrote: > > > Eric Sunshine <sunshine@sunshineco.com> writes: > > > >> +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname > > > >> + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ > > > > > > > > Should this rule also have a dependency upon "config.mak.autogen"? > > > > > > That is probably a good point. > > > > > > > Perhaps like this: > > > > > > > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile $(wildcard config.mak*) > > > > > > I'd rather not let changes to "config.mak-", which I keep in my > > > working tree (untracked and disabled copy of config.mak, that can be > > > readily activated by renaming), be part of dependency rules. > > > > > > If we know 'autogen' is the only dependency that optionally can > > > exist, then depending explicitly on $(wildcard config.mak.autogen) > > > would be a better alternative. > > > > When composing that email, I originally wrote $(wildcard > > config.mak.autogen) as the suggestion but changed it to the looser > > $(wildcard config.mak*) when I realized that the developer's own > > config.mak probably ought to be a dependency, as well. Taking your > > objection into consideration, we could mention both explicitly: > > > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile \ > > $(wildcard config.mak) $(wildcard config.mak.autogen) > > What about command-line options that influence the outcome? It sounds > like this is the same problem we have in lots of other places (like say, > compiler flags being updated), that we solve by generating the proposed > file output unconditionally and comparing it to what's on disk. E.g., > see the way GIT-CFLAGS or GIT-BUILD-OPTIONS is generated. *Sigh* I really did not want to do that because I thought it would be tedious and more complicated and result in a longer patch. Well, don't you know. The patch is actually *a lot* shorter now. So much so that range-diff thinks it is a different commit ;-) Thanks for the reality check/prod, Dscho
Hi Eric & Junio, On Mon, 15 Apr 2019, Eric Sunshine wrote: > On Mon, Apr 15, 2019 at 12:16 AM Eric Sunshine <sunshine@sunshineco.com> wrote: > > When composing that email, I originally wrote $(wildcard > > config.mak.autogen) as the suggestion but changed it to the looser > > $(wildcard config.mak*) when I realized that the developer's own > > config.mak probably ought to be a dependency, as well. Taking your > > objection into consideration, we could mention both explicitly: > > > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile \ > > $(wildcard config.mak) $(wildcard config.mak.autogen) > > Bleh, I forgot config.mak.uname from Dscho's original patch. > > Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname \ > $(wildcard config.mak) $(wildcard config.mak.autogen) Right. I had that locally in the meantime, but based on Peff's suggestion went for a GIT-CFLAGS like approach instead. Ciao, Dscho
On Thu, Apr 18, 2019 at 03:06:56PM +0200, Johannes Schindelin wrote: > > What about command-line options that influence the outcome? It sounds > > like this is the same problem we have in lots of other places (like say, > > compiler flags being updated), that we solve by generating the proposed > > file output unconditionally and comparing it to what's on disk. E.g., > > see the way GIT-CFLAGS or GIT-BUILD-OPTIONS is generated. > > *Sigh* > > I really did not want to do that because I thought it would be tedious and > more complicated and result in a longer patch. > > Well, don't you know. The patch is actually *a lot* shorter now. So much > so that range-diff thinks it is a different commit ;-) :) Great. I looked at the result in your v2 and it looks good to me. -Peff
diff --git a/Documentation/.gitignore b/Documentation/.gitignore index 3ef54e0adb..ea27148c59 100644 --- a/Documentation/.gitignore +++ b/Documentation/.gitignore @@ -13,3 +13,4 @@ mergetools-*.txt manpage-base-url.xsl SubmittingPatches.txt tmp-doc-diff/ +/GIT-EXCLUDED-PROGRAMS diff --git a/Documentation/Makefile b/Documentation/Makefile index af0e2cf11a..e22ea2f57c 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -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 diff --git a/Makefile b/Makefile index 5880d4d3a9..a5212c64bf 100644 --- a/Makefile +++ b/Makefile @@ -2455,22 +2455,25 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS) export DEFAULT_EDITOR DEFAULT_PAGER +Documentation/GIT-EXCLUDED-PROGRAMS: Makefile config.mak.uname + $(QUIET_GEN)echo "EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)" >$@ + .PHONY: doc man man-perl html info pdf -doc: man-perl +doc: man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation all -man: man-perl +man: man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation man man-perl: perl/build/man/man3/Git.3pm -html: +html: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation html -info: +info: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation info -pdf: +pdf: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation pdf XGETTEXT_FLAGS = \ @@ -2907,33 +2910,33 @@ endif install-gitweb: $(MAKE) -C gitweb install -install-doc: install-man-perl +install-doc: install-man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install -install-man: install-man-perl +install-man: install-man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-man -install-man-perl: man-perl +install-man-perl: man-perl Documentation/GIT-EXCLUDED-PROGRAMS $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3' (cd perl/build/man/man3 && $(TAR) cf - .) | \ (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -) -install-html: +install-html: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-html -install-info: +install-info: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-info -install-pdf: +install-pdf: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation install-pdf -quick-install-doc: +quick-install-doc: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation quick-install -quick-install-man: +quick-install-man: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation quick-install-man -quick-install-html: +quick-install-html: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation quick-install-html @@ -2988,7 +2991,7 @@ artifacts-tar:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) \ htmldocs = git-htmldocs-$(GIT_VERSION) manpages = git-manpages-$(GIT_VERSION) .PHONY: dist-doc distclean -dist-doc: +dist-doc: Documentation/GIT-EXCLUDED-PROGRAMS $(RM) -r .doc-tmp-dir mkdir .doc-tmp-dir $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc @@ -3035,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/ @@ -3062,7 +3066,7 @@ ALL_COMMANDS += gitweb ALL_COMMANDS += git-gui git-citool .PHONY: check-docs -check-docs:: +check-docs:: Documentation/GIT-EXCLUDED-PROGRAMS $(MAKE) -C Documentation lint-docs @(for v in $(patsubst %$X,%,$(ALL_COMMANDS)); \ do \