Skip to content

Commit 0cd2c38

Browse files
committed
doc: check well-formedness of delimited sections
Having an empty line before each delimited sections is not required by asciidoc, but it is a safety measure that prevents generating malformed asciidoc when generating translated documentation. When a delimited section appears just after a paragraph, the asciidoc processor checks that the length of the delimited section header is different from the length of the paragraph. If it is not, the asciidoc processor will generate a title. In the original English documentation, this is not a problem because the authors always check the output of the asciidoc processor and fix the length of the delimited section header if it turns out to be the same as the paragraph length. However, this is not the case for translations, where the authors have no way to check the length of the delimited section header or the output of the asciidoc processor. This can lead to a section title that is not intended. Indeed, this test also checks that titles are correctly formed, that is, the length of the underline is equal to the length of the title (otherwise it would not be a title but a section header). Finally, this test checks that the delimited section are terminated within the same file. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent bf4c91e commit 0cd2c38

12 files changed

+56
-3
lines changed

Documentation/RelNotes/1.6.2.4.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ exec >/var/tmp/1
3737
echo O=$(git describe maint)
3838
O=v1.6.2.3-38-g318b847
3939
git shortlog --no-merges $O..maint
40+
---

Documentation/diff-format.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ if the file was renamed on any side of history. With
103103
followed by the name of the path in the merge commit.
104104

105105
Examples for `-c` and `--cc` without `--combined-all-paths`:
106+
106107
------------------------------------------------
107108
::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c
108109
::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh

Documentation/git-commit.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ variable (see linkgit:git-config[1]).
279279
+
280280
--
281281
It is a rough equivalent for:
282+
282283
------
283284
$ git reset --soft HEAD^
284285
$ ... do something else to come up with the right tree ...

Documentation/git-fast-import.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,11 @@ Marks must be declared (via `mark`) before they can be used.
579579
580580
The special case of restarting an incremental import from the
581581
current branch value should be written as:
582+
582583
----
583584
from refs/heads/branch^0
584585
----
586+
585587
The `^0` suffix is necessary as fast-import does not permit a branch to
586588
start from itself, and the branch is created in memory before the
587589
`from` command is even read from the input. Adding `^0` will force

Documentation/git-p4.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Clone
6666
~~~~~
6767
Generally, 'git p4 clone' is used to create a new Git directory
6868
from an existing p4 repository:
69+
6970
------------
7071
$ git p4 clone //depot/path/project
7172
------------

Documentation/git-rebase.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ In addition, the following pairs of options are incompatible:
687687
* --fork-point and --root
688688
689689
BEHAVIORAL DIFFERENCES
690-
-----------------------
690+
----------------------
691691

692692
`git rebase` has two primary backends: 'apply' and 'merge'. (The 'apply'
693693
backend used to be known as the 'am' backend, but the name led to

Documentation/git-svn.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,9 +1012,11 @@ branch.
10121012

10131013
If you do merge, note the following rule: 'git svn dcommit' will
10141014
attempt to commit on top of the SVN commit named in
1015+
10151016
------------------------------------------------------------------------
10161017
git log --grep=^git-svn-id: --first-parent -1
10171018
------------------------------------------------------------------------
1019+
10181020
You 'must' therefore ensure that the most recent commit of the branch
10191021
you want to dcommit to is the 'first' parent of the merge. Chaos will
10201022
ensue otherwise, especially if the first parent is an older commit on

Documentation/gitprotocol-http.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ Extra Parameter.
318318

319319

320320
Smart Service git-upload-pack
321-
------------------------------
321+
-----------------------------
322322
This service reads from the repository pointed to by `$GIT_URL`.
323323
324324
Clients MUST first perform ref discovery with

Documentation/gitsubmodules.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ gitsubmodules - Mounting one repository inside another
88
SYNOPSIS
99
--------
1010
.gitmodules, $GIT_DIR/config
11+
1112
------------------
1213
git submodule
1314
git <command> --recurse-submodules
@@ -240,7 +241,7 @@ Workflow for a third party library
240241
241242
242243
Workflow for an artificially split repo
243-
--------------------------------------
244+
---------------------------------------
244245

245246
# Enable recursion for relevant commands, such that
246247
# regular commands recurse into submodules by default

Documentation/mergetools/vimdiff.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Description
33

44
When specifying `--tool=vimdiff` in `git mergetool` Git will open Vim with a 4
55
windows layout distributed in the following way:
6+
67
....
78
------------------------------------------
89
| | | |
@@ -56,6 +57,7 @@ needed in this case. The next layout definition is equivalent:
5657
+
5758
--
5859
If, for some reason, we are not interested in the `BASE` buffer.
60+
5961
....
6062
------------------------------------------
6163
| | | |
@@ -72,6 +74,7 @@ If, for some reason, we are not interested in the `BASE` buffer.
7274
Only the `MERGED` buffer will be shown. Note, however, that all the other
7375
ones are still loaded in vim, and you can access them with the "buffers"
7476
command.
77+
7578
....
7679
------------------------------------------
7780
| |
@@ -88,6 +91,7 @@ command.
8891
When `MERGED` is not present in the layout, you must "mark" one of the
8992
buffers with an arobase (`@`). That will become the buffer you need to edit and
9093
save after resolving the conflicts.
94+
9195
....
9296
------------------------------------------
9397
| | |
@@ -106,6 +110,7 @@ save after resolving the conflicts.
106110
Three tabs will open: the first one is a copy of the default layout, while
107111
the other two only show the differences between (`BASE` and `LOCAL`) and
108112
(`BASE` and `REMOTE`) respectively.
113+
109114
....
110115
------------------------------------------
111116
| <TAB #1> | TAB #2 | TAB #3 | |
@@ -119,6 +124,7 @@ the other two only show the differences between (`BASE` and `LOCAL`) and
119124
| |
120125
------------------------------------------
121126
....
127+
122128
....
123129
------------------------------------------
124130
| TAB #1 | <TAB #2> | TAB #3 | |
@@ -132,6 +138,7 @@ the other two only show the differences between (`BASE` and `LOCAL`) and
132138
| | |
133139
------------------------------------------
134140
....
141+
135142
....
136143
------------------------------------------
137144
| TAB #1 | TAB #2 | <TAB #3> | |
@@ -151,6 +158,7 @@ the other two only show the differences between (`BASE` and `LOCAL`) and
151158
--
152159
Same as the previous example, but adds a fourth tab with the same
153160
information as the first tab, with a different layout.
161+
154162
....
155163
---------------------------------------------
156164
| TAB #1 | TAB #2 | TAB #3 | <TAB #4> |

0 commit comments

Comments
 (0)