git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH v2 0/3] Documentation: refactor config variable descriptions

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 27, 2010, 10:56 UTC
Message-ID
<201010271256.16836.jnareb@gmail.com>
In-Reply-To
<201010251749.04784.jnareb@gmail.com>
On Mon, 25 Oct 2010, Jakub Narebski wrote:
> On Mon, 25 Oct 2010, Jeff King wrote:
>> On Mon, Oct 25, 2010 at 02:44:06PM +0200, Jakub Narebski wrote:
Show 9 quoted lines
>>>>   2. You recursively follow includes via include::. This means that the
>>>>      make rule is not accurate. E.g., try:
>>> [...]
>>> We do that: see 'doc.dep' target in Documentation/Makefile.  We just
>>> need for this target to also add dependencies for config-vars.txt
>>> (perhaps separate mode for make-config-list.perl, or perhaps 
>>> build-docdep.perl should be config-vars-src.txt aware...).
>> 
>> Yeah, that would definitely work.

The part of patch (commit) touching Documentation/Makefile could look like this:

-- 8< --
diff --git a/Documentation/Makefile b/Documentation/Makefile
index e117bc4..351aa9c 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -212,9 +212,12 @@ install-html: html
 #
 # Determine "include::" file references in asciidoc files.
 #
-doc.dep : $(wildcard *.txt) build-docdep.perl
+doc.dep : $(wildcard *.txt) build-docdep.perl make-config-list.perl
 	$(QUIET_GEN)$(RM) $@+ $@ && \
 	$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
+	$(PERL_PATH) ./make-config-list.perl --deps=config-vars.txt \
+		--mainlist=config-vars-src.txt $(MAN_TXT) \
+		>>$@+ $(QUIET_STDERR) && \
 	mv $@+ $@
 
 -include doc.dep
@@ -320,6 +323,11 @@ howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
 	'$(SHELL_PATH_SQ)' ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
 	mv $@+ $@
 
+config-vars.txt: config-vars-src.txt $(MAN_TXT) make-config-list.perl
+	$(PERL_PATH) ./make-config-list.perl \
+		--mainlist=$< --ignore=$@ $(MAN_TXT) >$@+ && \
+	mv $@+ $@
+
 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
 	$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 $*.txt
 
-- >8 --

Note that while in rule for config-vars.txt target we can use automatic
variables, we have to spell filenames in full in the part of doc.dep
rules that generate dependency for config-vars.txt.  Note also that we
have to keep those explicit and implicit filenames in sync across those
two rules.
 
> Though simpler would be just to not use or turn off following includes,
> as it turned out that it doesn't matter to follow includes in manpages:
> if we include with config variables, it is to also include it in 
> config-vars-src.txt.
> 
> Well, assuming that we don't have to follow includes in config-vars-src.txt;
> otherwise we have to generate line in doc.dep for that include anyway.

Decision time!!!

There are two possible approaches:

1. Don't follow includes in manpages (in manpage sources), and don't follow
   includes in config-vars-src.txt

   Advantages:
   * Less code to write and maintain
   * No need to keep filenames in rule for config-vars.txt and for doc.dep
     in sync.

   Disadvantages:
   * Theoretically fragile: it depends on two assumptions:

     A. If file included in manpage contains description of config vars,
        then this file would be included also in config-vars-src.txt

     B. For config variables inside file(s) included by config-vars-src.txt,
        if they are present in individual manpage, it is done by inclusion
        of said file.

     Those assumptions are two sides of the same coin, and can be written
     as: file included in manpagee can contain config variables if and only
     if it is included in config-vars-src.txt

2. Follow includes both in manpages and in config-vars-src.txt, and
   generate dependencies for config-vars.txt

   Advantages:
   * More generic solution

   Disadvantages:
   * Need to keep rules for doc.dep and for config-vars.txt in sync, as
     described above
   * config-vars.txt rule has more dependencies.

Now, which one to choose?
-- 
Jakub Narebski
Poland
Previous: Jakub NarebskiNext: Jens Lehmann
Message 10 of 19 in “Documentation: refactor config variable descriptions”
  1. 0/3 Documentation: refactor config variable descriptionsThomas Rast, Oct 22, 2010
  2. 3/3 Documentation: move format.* documentation to format-patchThomas Rast, Oct 22, 2010
  3. Jakub NarebskiOct 22, 2010
  4. Jeff KingOct 22, 2010
  5. Thomas RastOct 24, 2010
  6. Jeff KingOct 25, 2010
  7. Jakub NarebskiOct 25, 2010
  8. Jeff KingOct 25, 2010
  9. Jakub NarebskiOct 25, 2010
  10. Jakub NarebskiOct 27, 2010
  11. Jens LehmannNov 2, 2010
  12. Jakub NarebskiOct 22, 2010
  13. Jakub NarebskiOct 22, 2010
  14. Jakub NarebskiOct 22, 2010
  15. Documentation: complete config list from other manpagesThomas Rast, Oct 23, 2010
  16. Jakub NarebskiOct 23, 2010
  17. Jakub NarebskiOct 24, 2010
  18. 2/3 Documentation: complete config list from other manpagesJakub Narebski, Oct 24, 2010
  19. 2/3 Documentation: complete config list from other manpagesJakub Narebski, Oct 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.