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

Re: [PATCH 2/24] Documentation: Add variable-substitution script

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 26, 2010, 19:51 UTC
Message-ID
<20100726195144.GC1043@burratino>
In-Reply-To
<049043aa444288fd9409a3706fe3190fd679cb7d.1280169048.git.trast@student.ethz.ch>
Thomas Rast wrote:
Show 13 quoted lines
>   ./subst-config.perl <vars> <in> <out>
> 
> It first reads <vars> for variable-documenting blocks.  A line
> consisting of '<name>::' starts the block for <name>, except inside a
> '--' delimited block (which is used to generate sub-lists).  A block
> extends until the first blank line, which is what asciidoc also looks
> for.
> 
> Then it copies from <in> to <out>, substituting lines of the form
> 
>   @@CONFIG(<name>)@@
> 
> with the documentation block for <name>.
Neat.  Thanks for picking this up.  

I would like to make the git-config(1) man page more like the command list in git(1) and less like a concatenation of CONFIGURATION sections, but regardless, this is a good first step.

Show 12 quoted lines
> diff --git a/Documentation/config-vars.txt b/Documentation/config-vars.txt
> index b82fada..3fcefe9 100644
> --- a/Documentation/config-vars.txt
> +++ b/Documentation/config-vars.txt
> @@ -689,6 +689,7 @@ diff.mnemonicprefix::
>  	standard "a/" and "b/" depending on what is being compared.  When
>  	this configuration is in effect, reverse diff output also swaps
>  	the order of the prefixes:
> +
>  diff.noprefix::
>  	If set, 'git diff' does not show any source or destination prefix.
>  `git diff`;;

Does this have an effect on the resulting markup? It looks like an independent syntax fix.

> +++ b/Documentation/subst-config.perl
> @@ -0,0 +1,74 @@
[...]
> +if (!$rc or (!-r $varlist or !-r $input)) {
> +    print "$0 --varlist=<varlist> --input=<in> --output=<out>\n";
> +    exit 1;
> +}

So the commit message is out of date (the new usage is more clear, anyway).

> +%.txt.cv : %.txt subst-config.perl config-vars.txt

The asciidoc markup is supposed to itself be suitable documentation. Maybe eventually we will have to drop that pretence and generate .txt files at build time.

Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Previous: Thomas RastNext: Ævar Arnfjörð Bjarmason
Message 3 of 14 in “Documentation: refactor config variable descriptions”
  1. 0/24 Documentation: refactor config variable descriptionsThomas Rast, Jul 26, 2010
  2. 2/24 Documentation: Add variable-substitution scriptThomas Rast, Jul 26, 2010
  3. Jonathan NiederJul 26, 2010
  4. Ævar Arnfjörð BjarmasonJul 26, 2010
  5. Jakub NarebskiJul 26, 2010
  6. Ævar Arnfjörð BjarmasonJul 26, 2010
  7. 24/24 Documentation: include configuration options in manpagesThomas Rast, Jul 26, 2010
  8. Jonathan NiederJul 26, 2010
  9. Ævar Arnfjörð BjarmasonJul 26, 2010
  10. Ævar Arnfjörð BjarmasonJul 26, 2010
  11. Jonathan NiederJul 26, 2010
  12. Ævar Arnfjörð BjarmasonJul 26, 2010
  13. Sverre RabbelierJul 27, 2010
  14. Junio C HamanoJul 28, 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.