Skip to contentSkip to conversation

config doc: indent descriptions of feature.* variables

PATCH In review Andrei Rybak 7 participants 9 messages Jun 2, 2021 – Jun 3, 2021 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config doc: indent descriptions of feature.* variables

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

---
 Documentation/config/feature.txt | 40 +++++++++++++++++---------------
 1 file changed, 21 insertions(+), 19 deletions(-)
Documentation/config/feature.txt +21 -19
index cdecd04e5b..2c4dee170b 100644
@@ -3,24 +3,26 @@ feature.*::
 	a group of other config settings. These groups are created by the Git
 	developer community as recommended defaults and are subject to change.
 	In particular, new config options may be added with different defaults.
-
-feature.experimental::
-	Enable config options that are new to Git, and are being considered for
-	future defaults. Config settings included here may be added or removed
-	with each release, including minor version updates. These settings may
-	have unintended interactions since they are so new. Please enable this
-	setting if you are interested in providing feedback on experimental
-	features. The new default values are:
 +
-* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
-skipping more commits at a time, reducing the number of round trips.
+--
+	feature.experimental::
+		Enable config options that are new to Git, and are being considered for
+		future defaults. Config settings included here may be added or removed
+		with each release, including minor version updates. These settings may
+		have unintended interactions since they are so new. Please enable this
+		setting if you are interested in providing feedback on experimental
+		features. The new default values are:
+	+
+	* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
+	skipping more commits at a time, reducing the number of round trips.
 
-feature.manyFiles::
-	Enable config options that optimize for repos with many files in the
-	working directory. With many files, commands such as `git status` and
-	`git checkout` may be slow and these new defaults improve performance:
-+
-* `index.version=4` enables path-prefix compression in the index.
-+
-* `core.untrackedCache=true` enables the untracked cache. This setting assumes
-that mtime is working on your machine.
+	feature.manyFiles::
+		Enable config options that optimize for repos with many files in the
+		working directory. With many files, commands such as `git status` and
+		`git checkout` may be slow and these new defaults improve performance:
+	+
+	* `index.version=4` enables path-prefix compression in the index.
+	+
+	* `core.untrackedCache=true` enables the untracked cache. This setting assumes
+	that mtime is working on your machine.
+--
Signature · 1 line
2.31.1
#1 lore raw
Quoted 3 lines · Andrei Rybak

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Skimming over Documentation, only "advice.*" does grouping and indenting, however, "advice." part is being skipped there.

I don't know what is the preference.

-- Danh

Quoted 62 lines

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

---
 Documentation/config/feature.txt | 40 +++++++++++++++++---------------
 1 file changed, 21 insertions(+), 19 deletions(-)
Documentation/config/feature.txt +21 -19
index cdecd04e5b..2c4dee170b 100644
@@ -3,24 +3,26 @@ feature.*::
 	a group of other config settings. These groups are created by the Git
 	developer community as recommended defaults and are subject to change.
 	In particular, new config options may be added with different defaults.
-
-feature.experimental::
-	Enable config options that are new to Git, and are being considered for
-	future defaults. Config settings included here may be added or removed
-	with each release, including minor version updates. These settings may
-	have unintended interactions since they are so new. Please enable this
-	setting if you are interested in providing feedback on experimental
-	features. The new default values are:
 +
-* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
-skipping more commits at a time, reducing the number of round trips.
+--
+	feature.experimental::
+		Enable config options that are new to Git, and are being considered for
+		future defaults. Config settings included here may be added or removed
+		with each release, including minor version updates. These settings may
+		have unintended interactions since they are so new. Please enable this
+		setting if you are interested in providing feedback on experimental
+		features. The new default values are:
+	+
+	* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
+	skipping more commits at a time, reducing the number of round trips.
 
-feature.manyFiles::
-	Enable config options that optimize for repos with many files in the
-	working directory. With many files, commands such as `git status` and
-	`git checkout` may be slow and these new defaults improve performance:
-+
-* `index.version=4` enables path-prefix compression in the index.
-+
-* `core.untrackedCache=true` enables the untracked cache. This setting assumes
-that mtime is working on your machine.
+	feature.manyFiles::
+		Enable config options that optimize for repos with many files in the
+		working directory. With many files, commands such as `git status` and
+		`git checkout` may be slow and these new defaults improve performance:
+	+
+	* `index.version=4` enables path-prefix compression in the index.
+	+
+	* `core.untrackedCache=true` enables the untracked cache. This setting assumes
+	that mtime is working on your machine.
+--
Signature · 1 line
2.31.1
Signature · 1 line
Danh
#2 lore raw
In reply to Andrei Rybak
Quoted 6 lines · Andrei Rybak

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

I'm not sure how these extra tabs help in the rendered text, or in the formatted HTML output for the git-scm.com web page. I do believe that we would want to re-wrap the paragraphs to ensure we are not using too many characters per line.

Is there precedence for a simple tabbing like this? I was able to find a similar grouping for advice.* in Documentation/config/advice.txt, but it uses a different kind of grouping. Perhaps reorganize the file to use that strategy instead?

Or, perhaps just point me to an existing use of this pattern.

Thanks,
-Stolee

#3 lore raw
Quoted 13 lines · Derrick Stolee
Quoted 6 lines · Andrei Rybak

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

I'm not sure how these extra tabs help in the rendered text, or in the formatted HTML output for the git-scm.com web page. I do believe that we would want to re-wrap the paragraphs to ensure we are not using too many characters per line.

Quoted 4 lines

Is there precedence for a simple tabbing like this? I was able to find a similar grouping for advice.* in Documentation/config/advice.txt, but it uses a different kind of grouping. Perhaps reorganize the file to use that strategy instead?

AsciiDoc has a couple of ways to indent a subsection, one example (which uses the same style '--' header as in these patches) can be found in 9218c6a40c (midx: allow marking a pack as preferred, 2021-03-30).

Quoted 1 line

Or, perhaps just point me to an existing use of this pattern.

git-scm.com doesn't have 9218c6a40c yet, since it won't be released until 2.32, but grepping around for '^--' in Documentation shows some other results.

Thanks,
Taylor

#4 lore raw
Quoted 23 lines · Taylor Blau
Quoted 13 lines · Derrick Stolee
Quoted 6 lines · Andrei Rybak

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

I'm not sure how these extra tabs help in the rendered text, or in the formatted HTML output for the git-scm.com web page. I do believe that we would want to re-wrap the paragraphs to ensure we are not using too many characters per line.

Quoted 4 lines

Is there precedence for a simple tabbing like this? I was able to find a similar grouping for advice.* in Documentation/config/advice.txt, but it uses a different kind of grouping. Perhaps reorganize the file to use that strategy instead?

AsciiDoc has a couple of ways to indent a subsection, one example (which uses the same style '--' header as in these patches) can be found in 9218c6a40c (midx: allow marking a pack as preferred, 2021-03-30).

Quoted 5 lines
Quoted 1 line

Or, perhaps just point me to an existing use of this pattern.

git-scm.com doesn't have 9218c6a40c yet, since it won't be released until 2.32, but grepping around for '^--' in Documentation shows some other results.

One thing worth noting if this is picked up, I think the + continuations inside the -- open block should be removed. They render fine in asciidoc, but in asciidoctor the + characters remain in the rendered output.

Here's a doc-diff with and without the additional + continuations in asciidoctor:

--- a/git-config.1 2021-06-01 21:39:56.769640893 -0400
+++ b/git-config.1 2021-06-01 21:40:03.318893602 -0400
@@ -2474,7 +2474,7 @@
version updates. These settings may have unintended interactions since they are so new. Please enable this setting if you are interested in providing feedback on experimental
- features. The new default values are: +
+ features. The new default values are:

• fetch.negotiationAlgorithm=skipping may improve fetch
negotiation times by skipping more commits at a time,
@@ -2484,10 +2484,10 @@
Enable config options that optimize for repos with many files in the working directory. With many files, commands such as git status and git checkout may be slow and these new defaults
- improve performance: +
+ improve performance:

• index.version=4 enables path-prefix compression in the
- index. +
+ index.

• core.untrackedCache=true enables the untracked cache. This
setting assumes that mtime is working on your machine.

Here's what I suggest be squashed into this patch:

Documentation/config/feature.txt +3 -3
index 2c4dee170b..7975ec35fd 100644
@@ -12,7 +12,7 @@ feature.*::
 		have unintended interactions since they are so new. Please enable this
 		setting if you are interested in providing feedback on experimental
 		features. The new default values are:
-	+
+
 	* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
 	skipping more commits at a time, reducing the number of round trips.
 
@@ -20,9 +20,9 @@ feature.*::
 		Enable config options that optimize for repos with many files in the
 		working directory. With many files, commands such as `git status` and
 		`git checkout` may be slow and these new defaults improve performance:
-	+
+
 	* `index.version=4` enables path-prefix compression in the index.
-	+
+
 	* `core.untrackedCache=true` enables the untracked cache. This setting assumes
 	that mtime is working on your machine.
 --

With the above, the man page output renders identically with asciidoc (9.1.0) and asciidoctor (I tested both 2.0.10 and 2.0.15).

The asciidoc documentation[1] says:

If you’re attaching more than one block to a list item, you’re strongly encouraged to wrap the content inside an open block. That way, you only need a single list continuation line to attach the open block to the list item. Within the open block, you write like you normally would, no longer having to worry about adding list continuations between the blocks to keep them attached to the list item.

[1] https://docs.asciidoctor.org/asciidoc/latest/lists/continuation/#list-continuation

Only mildly related, but while I was looking at the output, I noticed that the man page renders the phrase "The config settings that start with feature. modify the defaults" oddly. It places two spaces after the full stop. It might be worth writing that sentence slightly differently to avoid that. Maybe something like:

- The config settings that start with feature. modify the defaults of
+ The feature.* variables modify the defaults of

Signature · 1 line
Todd
#5 lore raw
Quoted 24 lines · Todd Zullinger
Documentation/config/feature.txt +3 -3
@@ -12,7 +12,7 @@ feature.*::
 		have unintended interactions since they are so new. Please enable this
 		setting if you are interested in providing feedback on experimental
 		features. The new default values are:
-	+
+
 	* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
 	skipping more commits at a time, reducing the number of round trips.
 
@@ -20,9 +20,9 @@ feature.*::
 		Enable config options that optimize for repos with many files in the
 		working directory. With many files, commands such as `git status` and
 		`git checkout` may be slow and these new defaults improve performance:
-	+
+
 	* `index.version=4` enables path-prefix compression in the index.
-	+
+
 	* `core.untrackedCache=true` enables the untracked cache. This setting assumes
 	that mtime is working on your machine.
 --
Quoted 3 lines

With the above, the man page output renders identically with asciidoc (9.1.0) and asciidoctor (I tested both 2.0.10 and 2.0.15).

I can confirm the above looks fine in both.

Signature · 1 line
Felipe Contreras
#6 lore raw
In reply to Andrei Rybak
Quoted 52 lines · Andrei Rybak

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

---
 Documentation/config/feature.txt | 40 +++++++++++++++++---------------
 1 file changed, 21 insertions(+), 19 deletions(-)
Documentation/config/feature.txt +11 -19
index cdecd04e5b..2c4dee170b 100644
@@ -3,24 +3,26 @@ feature.*::
 	a group of other config settings. These groups are created by the Git
 	developer community as recommended defaults and are subject to change.
 	In particular, new config options may be added with different defaults.
-
-feature.experimental::
-	Enable config options that are new to Git, and are being considered for
-	future defaults. Config settings included here may be added or removed
-	with each release, including minor version updates. These settings may
-	have unintended interactions since they are so new. Please enable this
-	setting if you are interested in providing feedback on experimental
-	features. The new default values are:
 +
-* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
-skipping more commits at a time, reducing the number of round trips.
+--
+	feature.experimental::
+		Enable config options that are new to Git, and are being considered for
+		future defaults. Config settings included here may be added or removed
+		with each release, including minor version updates. These settings may
+		have unintended interactions since they are so new. Please enable this
+		setting if you are interested in providing feedback on experimental
+		features. The new default values are:
+	+
+	* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
+	skipping more commits at a time, reducing the number of round trips.
 
-feature.manyFiles::
-	Enable config options that optimize for repos with many files in the
-	working directory. With many files, commands such as `git status` and
-	`git checkout` may be slow and these new defaults improve performance:
-+
-* `index.version=4` enables path-prefix compression in the index.
-+
-* `core.untrackedCache=true` enables the untracked cache. This setting assumes
-that mtime is working on your machine.

Documentation/config/feature.txt feature.*:: · line 28

Quoted 10 lines
Documentation/config/feature.txt +10 -0
+	feature.manyFiles::
+		Enable config options that optimize for repos with many files in the
+		working directory. With many files, commands such as `git status` and
+		`git checkout` may be slow and these new defaults improve performance:
+	+
+	* `index.version=4` enables path-prefix compression in the index.
+	+
+	* `core.untrackedCache=true` enables the untracked cache. This setting assumes
+	that mtime is working on your machine.
+--

I don't know if/how this helps readability, but this breaks the feature.* generation of these variables in config-list.h, see generate-configlist.sh.

So if you make this change you need to fix that script as well.

#7 lore raw
Quoted 69 lines · Ævar Arnfjörð Bjarmason
Quoted 52 lines · Andrei Rybak

Config variables feature.experimental and feature.manyFiles are grouped together under "feature.*". However, this is not easily visible when scanning the help page of git-config.

Indent the descriptions of individual feature.* config variables to help the reader distinguish this group of variables.

---
 Documentation/config/feature.txt | 40 +++++++++++++++++---------------
 1 file changed, 21 insertions(+), 19 deletions(-)
Documentation/config/feature.txt +11 -19
index cdecd04e5b..2c4dee170b 100644
@@ -3,24 +3,26 @@ feature.*::
 	a group of other config settings. These groups are created by the Git
 	developer community as recommended defaults and are subject to change.
 	In particular, new config options may be added with different defaults.
-
-feature.experimental::
-	Enable config options that are new to Git, and are being considered for
-	future defaults. Config settings included here may be added or removed
-	with each release, including minor version updates. These settings may
-	have unintended interactions since they are so new. Please enable this
-	setting if you are interested in providing feedback on experimental
-	features. The new default values are:
 +
-* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
-skipping more commits at a time, reducing the number of round trips.
+--
+	feature.experimental::
+		Enable config options that are new to Git, and are being considered for
+		future defaults. Config settings included here may be added or removed
+		with each release, including minor version updates. These settings may
+		have unintended interactions since they are so new. Please enable this
+		setting if you are interested in providing feedback on experimental
+		features. The new default values are:
+	+
+	* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
+	skipping more commits at a time, reducing the number of round trips.
 
-feature.manyFiles::
-	Enable config options that optimize for repos with many files in the
-	working directory. With many files, commands such as `git status` and
-	`git checkout` may be slow and these new defaults improve performance:
-+
-* `index.version=4` enables path-prefix compression in the index.
-+
-* `core.untrackedCache=true` enables the untracked cache. This setting assumes
-that mtime is working on your machine.

Documentation/config/feature.txt feature.*:: · line 28

Quoted 10 lines
Documentation/config/feature.txt +10 -0
+	feature.manyFiles::
+		Enable config options that optimize for repos with many files in the
+		working directory. With many files, commands such as `git status` and
+		`git checkout` may be slow and these new defaults improve performance:
+	+
+	* `index.version=4` enables path-prefix compression in the index.
+	+
+	* `core.untrackedCache=true` enables the untracked cache. This setting assumes
+	that mtime is working on your machine.
+--

I don't know if/how this helps readability, but this breaks the feature.* generation of these variables in config-list.h, see generate-configlist.sh.

Quoted 1 line

So if you make this change you need to fix that script as well.

Being a bit more awake I'd prefer not to see this patch go in in its current form, here's why:

I've got a WIP series I was going to submit soon that:

1. Ensures that all config variables are discussed canonically in git-config(1), e.g. for sendemail.* we now point elsewhere.

2. Adds a "CONFIGURATION" section to all relevant manpages, which then include the relevant section(s) for variables that affect those commands.

3. #2 requires splitting up many of Documentation/config/whatever.txt into Documentation/config/whatever/<sub-lists>.txt, notably things like Documentation/config/color.txt need to become Documentation/config/color/{diff,status,...}.txt so Documentation/git-{status,diff,...}.txt can include them.

This only works because we don't have something like your proposed patch here.

I.e. asciidoc isn't going to take kindly to feature.manyFiles being indented when I include it in git-{status,checkout}.txt, in its CONFIGURATION section that'll be either a syntax error, or look out of place.

But more importantly there seems to just be a better way to do it, looking at the current config file we have the pattern you're trying to introduce for advice.* already, except it's differently formatted, i.e.:

advice.*
SubVariaBle::

But yours is:

feature.*
feature.SubVariaBle::

The advice.* ones also have the config-list.h issue I noted. But in any case, it seems to me that the issue is that we group these things at the top-level under git-config(1)'s "CONFIGURATION FILE" section, we should really split them into a CONFIGURATION VARIABLES, and then have these advice.* or whatever be a section on the level of the current "Variables", i.e. something like the incomplete patch below[1].

That would both look nicer IMO, and allow us to not indent things in Documentation/config/*.txt. If you agree I'd very much like you to pick up & run with that alternate approach instead, what do you think?

1.

Documentation/config.txt +16 -3
index bf82766a6a2..5e52b0db1fa 100644
@@ -299,9 +299,8 @@ pathname::
 	is expanded to the value of `$HOME`, and `~user/` to the
 	specified user's home directory.
 
-
-Variables
-~~~~~~~~~
+CONFIGURATION VARIABLES
+-----------------------
 
 Note that this list is non-comprehensive and not necessarily complete.
 For command-specific variables, you will find a more detailed description
@@ -312,10 +311,24 @@ inventing new variables for use in your own tool, make sure their
 names do not conflict with those that are used by Git itself and
 other popular tools, and describe them in your documentation.
 
+
+advice.*
+~~~~~~~~
+
+These variables control various optional help messages designed to aid
+new users. All 'advice.*' variables default to 'true', and you can
+tell Git that you do not need help by setting these to 'false':
+
 include::config/advice.txt[]
 
+core.*
+~~~~~~
+
 include::config/core.txt[]
 
+add.*
+~~~~~
+
 include::config/add.txt[]
 
 include::config/alias.txt[]
Documentation/config/advice.txt +119 -126

245 lines not on this page · raw message

#8 lore raw
Quoted 27 lines · Ævar Arnfjörð Bjarmason
Documentation/config.txt +10 -3
@@ -299,9 +299,8 @@ pathname::
 	is expanded to the value of `$HOME`, and `~user/` to the
 	specified user's home directory.
 
-
-Variables
-~~~~~~~~~
+CONFIGURATION VARIABLES
+-----------------------
 
 Note that this list is non-comprehensive and not necessarily complete.
 For command-specific variables, you will find a more detailed description
@@ -312,10 +311,24 @@ inventing new variables for use in your own tool, make sure their
 names do not conflict with those that are used by Git itself and
 other popular tools, and describe them in your documentation.
 
+
+advice.*
+~~~~~~~~
+
+These variables control various optional help messages designed to aid
+new users. All 'advice.*' variables default to 'true', and you can
+tell Git that you do not need help by setting these to 'false':
+
 include::config/advice.txt[]

Documentation/config.txt inventing new variables for use in your own tool, make sure their · line 332

Quoted 10 lines
Documentation/config.txt +6 -0
 
+core.*
+~~~~~~
+
 include::config/core.txt[]
 
+add.*
+~~~~~
+
 include::config/add.txt[]

This looks much better to me. +1

Quoted 12 lines
Documentation/config.txt +0 -0
 include::config/alias.txt[]
Documentation/config/advice.txt +0 -6
index 8b2849ff7b3..35d6b0e20ff 100644
@@ -1,126 +1,119 @@
-advice.*::
-	These variables control various optional help messages designed to
-	aid new users. All 'advice.*' variables default to 'true', and you
-	can tell Git that you do not need help by setting these to 'false':
-+
---

...

Quoted 12 lines

---

Documentation/config/advice.txt +11 -0
+advice.*fetchShowForcedUpdates::
+	Advice shown when linkgit:git-fetch[1] takes a long time
+	to calculate forced updates after ref updates, or to warn
+	that the check is disabled.
+advice.pushUpdateRejected::
+	Set this variable to 'false' if you want to disable
+	'pushNonFFCurrent', 'pushNonFFMatching', 'pushAlreadyExists',
+	'pushFetchFirst', 'pushNeedsForce', and 'pushRefNeedsUpdate'
+	simultaneously.
+advice.pushNonFFCurrent::
+	Advice shown when linkgit:git-push[1] fails due to a

Documentation/config/advice.txt line 21

Quoted 10 lines
Documentation/config/advice.txt +10 -0
+	non-fast-forward update to the current branch.
+advice.pushNonFFMatching::
+	Advice shown when you ran linkgit:git-push[1] and pushed
+	'matching refs' explicitly (i.e. you used ':', or
+	specified a refspec that isn't your current branch) and
+	it resulted in a non-fast-forward error.
+advice.pushAlreadyExists::
+	Shown when linkgit:git-push[1] rejects an update that
+	does not qualify for fast-forwarding (e.g., a tag.)
+pushFetchFirst::

I presume this also has the 'advice.' prefix added (and so do the rest), it was just an example patch.

Cheers.

Signature · 1 line
Felipe Contreras