docs: add and use include template for config/* includes
In b6a8d09f6d8 (gc docs: include the "gc.*" section from "config" in
"gc", 2019-04-07) the "git gc" documentation was made to include the
config/gc.txt in its "CONFIGURATION" section. We do that in several
other places, but "git gc" was the only one with a blurb above the
include to orient the reader.
We don't want readers to carefully scrutinize "git-config(1)" and
"git-gc(1)" looking for discrepancies, instead we should tell them
that the latter includes a part of the former.
This change formalizes that wording in two new templates to be
included, one for the "git gc" case where the entire section is
included from "git-config(1)", and another for when the inclusion of
"git-config(1)" follows discussion unique to that documentation. In
order to use that re-arrange the order of those being discussed in the
"git-merge(1)" documentation.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committedSep 7, 2022 at 10:26 UTC18d89fe25c80de269e8c6d14213ff400bc480e96
index 5088783dcc..29318ea957 100644--- a/Documentation/git-fsck.txt+++ b/Documentation/git-fsck.txt@@ -107,6 +107,8 @@ care about this output and want to speed it up further. CONFIGURATION -------------+include::includes/cmd-config-section-all.txt[]+ include::config/fsck.txt[] DISCUSSION
Documentation/git-gc.txt
+1-2
index 0af7540a0c..a65c9aa62d 100644--- a/Documentation/git-gc.txt+++ b/Documentation/git-gc.txt@@ -110,8 +110,7 @@ users and their repositories. CONFIGURATION --------------The below documentation is the same as what's found in-linkgit:git-config[1]:+include::includes/cmd-config-section-all.txt[] include::config/gc.txt[]
Documentation/git-imap-send.txt
+2
index 63cf498ce9..f7b1851514 100644--- a/Documentation/git-imap-send.txt+++ b/Documentation/git-imap-send.txt@@ -54,6 +54,8 @@ CONFIGURATION To use the tool, `imap.folder` and either `imap.tunnel` or `imap.host` must be set to appropriate values.+include::includes/cmd-config-section-rest.txt[]+ include::config/imap.txt[] EXAMPLES
Documentation/git-merge.txt
+4-1
index 3125473cc1..6e5db8ef4c 100644--- a/Documentation/git-merge.txt+++ b/Documentation/git-merge.txt@@ -386,13 +386,16 @@ include::merge-strategies.txt[] CONFIGURATION --------------include::config/merge.txt[] branch.<name>.mergeOptions:: Sets default options for merging into branch <name>. The syntax and supported options are the same as those of 'git merge', but option values containing whitespace characters are currently not supported.+include::includes/cmd-config-section-rest.txt[]++include::config/merge.txt[]+ SEE ALSO -------- linkgit:git-fmt-merge-msg[1], linkgit:git-pull[1],
Documentation/git-mergetool.txt
+3
index f784027bc1..c44e205629 100644--- a/Documentation/git-mergetool.txt+++ b/Documentation/git-mergetool.txt@@ -102,6 +102,9 @@ success of the resolution after the custom tool has exited. CONFIGURATION ------------- :git-mergetool: 1++include::includes/cmd-config-section-all.txt[]+ include::config/mergetool.txt[] TEMPORARY FILES
new file mode 100644index 0000000000..296a239f2a--- /dev/null+++ b/Documentation/includes/cmd-config-section-all.txt@@ -0,0 +1,3 @@+Everything below this line in this section is selectively included+from the linkgit:git-config[1] documentation. The content is the same+as what's found there:
new file mode 100644index 0000000000..b1e7682c1d--- /dev/null+++ b/Documentation/includes/cmd-config-section-rest.txt@@ -0,0 +1,3 @@+Everything above this line in this section isn't included from the+linkgit:git-config[1] documentation. The content that follows is the+same as what's found there: