Skip to content

Commit bac754e

Browse files
committed
Merge branch 'sg/asciidoctor-in-ci'
Update our support to format documentation in the CI environment, either with AsciiDoc ro Asciidoctor. * sg/asciidoctor-in-ci: ci: fix AsciiDoc/Asciidoctor stderr check in the documentation build job ci: stick with Asciidoctor v1.5.8 for now ci: install Asciidoctor in 'ci/install-dependencies.sh' Documentation/technical/protocol-v2.txt: fix formatting Documentation/technical/api-config.txt: fix formatting Documentation/git-diff-tree.txt: fix formatting
2 parents ec8fcc7 + 37fc8cb commit bac754e

File tree

5 files changed

+46
-36
lines changed

5 files changed

+46
-36
lines changed

Documentation/git-diff-tree.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ include::pretty-options.txt[]
118118

119119

120120
include::pretty-formats.txt[]
121+
121122
include::diff-format.txt[]
122123

123124
GIT

Documentation/technical/api-config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ A `config_set` can be used to construct an in-memory cache for
229229
config-like files that the caller specifies (i.e., files like `.gitmodules`,
230230
`~/.gitconfig` etc.). For example,
231231

232-
---------------------------------------
232+
----------------------------------------
233233
struct config_set gm_config;
234234
git_configset_init(&gm_config);
235235
int b;

Documentation/technical/protocol-v2.txt

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Git Wire Protocol, Version 2
2-
==============================
1+
Git Wire Protocol, Version 2
2+
============================
33

44
This document presents a specification for a version 2 of Git's wire
55
protocol. Protocol v2 will improve upon v1 in the following ways:
@@ -22,8 +22,8 @@ will be commands which a client can request be executed. Once a command
2222
has completed, a client can reuse the connection and request that other
2323
commands be executed.
2424

25-
Packet-Line Framing
26-
---------------------
25+
Packet-Line Framing
26+
-------------------
2727

2828
All communication is done using packet-line framing, just as in v1. See
2929
`Documentation/technical/pack-protocol.txt` and
@@ -34,31 +34,31 @@ In protocol v2 these special packets will have the following semantics:
3434
* '0000' Flush Packet (flush-pkt) - indicates the end of a message
3535
* '0001' Delimiter Packet (delim-pkt) - separates sections of a message
3636

37-
Initial Client Request
38-
------------------------
37+
Initial Client Request
38+
----------------------
3939

4040
In general a client can request to speak protocol v2 by sending
4141
`version=2` through the respective side-channel for the transport being
4242
used which inevitably sets `GIT_PROTOCOL`. More information can be
4343
found in `pack-protocol.txt` and `http-protocol.txt`. In all cases the
4444
response from the server is the capability advertisement.
4545

46-
Git Transport
47-
~~~~~~~~~~~~~~~
46+
Git Transport
47+
~~~~~~~~~~~~~
4848

4949
When using the git:// transport, you can request to use protocol v2 by
5050
sending "version=2" as an extra parameter:
5151

5252
003egit-upload-pack /project.git\0host=myserver.com\0\0version=2\0
5353

54-
SSH and File Transport
55-
~~~~~~~~~~~~~~~~~~~~~~~~
54+
SSH and File Transport
55+
~~~~~~~~~~~~~~~~~~~~~~
5656

5757
When using either the ssh:// or file:// transport, the GIT_PROTOCOL
5858
environment variable must be set explicitly to include "version=2".
5959

60-
HTTP Transport
61-
~~~~~~~~~~~~~~~~
60+
HTTP Transport
61+
~~~~~~~~~~~~~~
6262

6363
When using the http:// or https:// transport a client makes a "smart"
6464
info/refs request as described in `http-protocol.txt` and requests that
@@ -79,8 +79,8 @@ A v2 server would reply:
7979
Subsequent requests are then made directly to the service
8080
`$GIT_URL/git-upload-pack`. (This works the same for git-receive-pack).
8181

82-
Capability Advertisement
83-
--------------------------
82+
Capability Advertisement
83+
------------------------
8484

8585
A server which decides to communicate (based on a request from a client)
8686
using protocol version 2, notifies the client by sending a version string
@@ -101,8 +101,8 @@ to be executed by the client.
101101
key = 1*(ALPHA | DIGIT | "-_")
102102
value = 1*(ALPHA | DIGIT | " -_.,?\/{}[]()<>!@#$%^&*+=:;")
103103

104-
Command Request
105-
-----------------
104+
Command Request
105+
---------------
106106

107107
After receiving the capability advertisement, a client can then issue a
108108
request to select the command it wants with any particular capabilities
@@ -137,8 +137,8 @@ command be executed or can terminate the connection. A client may
137137
optionally send an empty request consisting of just a flush-pkt to
138138
indicate that no more requests will be made.
139139

140-
Capabilities
141-
--------------
140+
Capabilities
141+
------------
142142

143143
There are two different types of capabilities: normal capabilities,
144144
which can be used to to convey information or alter the behavior of a
@@ -153,8 +153,8 @@ management on the server side in order to function correctly. This
153153
permits simple round-robin load-balancing on the server side, without
154154
needing to worry about state management.
155155

156-
agent
157-
~~~~~~~
156+
agent
157+
~~~~~
158158

159159
The server can advertise the `agent` capability with a value `X` (in the
160160
form `agent=X`) to notify the client that the server is running version
@@ -168,8 +168,8 @@ printable ASCII characters except space (i.e., the byte range 32 < x <
168168
and debugging purposes, and MUST NOT be used to programmatically assume
169169
the presence or absence of particular features.
170170

171-
ls-refs
172-
~~~~~~~~~
171+
ls-refs
172+
~~~~~~~
173173

174174
`ls-refs` is the command used to request a reference advertisement in v2.
175175
Unlike the current reference advertisement, ls-refs takes in arguments
@@ -199,8 +199,8 @@ The output of ls-refs is as follows:
199199
symref = "symref-target:" symref-target
200200
peeled = "peeled:" obj-id
201201

202-
fetch
203-
~~~~~~~
202+
fetch
203+
~~~~~
204204

205205
`fetch` is the command used to fetch a packfile in v2. It can be looked
206206
at as a modified version of the v1 fetch where the ref-advertisement is
@@ -444,8 +444,8 @@ header.
444444
2 - progress messages
445445
3 - fatal error message just before stream aborts
446446

447-
server-option
448-
~~~~~~~~~~~~~~~
447+
server-option
448+
~~~~~~~~~~~~~
449449

450450
If advertised, indicates that any number of server specific options can be
451451
included in a request. This is done by sending each option as a

ci/install-dependencies.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ StaticAnalysis)
5454
Documentation)
5555
sudo apt-get -q update
5656
sudo apt-get -q -y install asciidoc xmlto
57+
58+
test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
59+
gem install --version 1.5.8 asciidoctor
5760
;;
5861
esac
5962

ci/test-documentation.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,38 @@
55

66
. ${0%/*}/lib.sh
77

8-
test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
9-
gem install asciidoctor
8+
filter_log () {
9+
sed -e '/^GIT_VERSION = /d' \
10+
-e '/^ \* new asciidoc flags$/d' \
11+
"$1"
12+
}
1013

1114
make check-builtins
1215
make check-docs
1316

1417
# Build docs with AsciiDoc
15-
make doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
16-
! test -s stderr.log
18+
make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
19+
cat stderr.raw
20+
filter_log stderr.raw >stderr.log
21+
test ! -s stderr.log
1722
test -s Documentation/git.html
1823
test -s Documentation/git.xml
1924
test -s Documentation/git.1
2025
grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
2126

22-
rm -f stdout.log stderr.log
27+
rm -f stdout.log stderr.log stderr.raw
2328
check_unignored_build_artifacts
2429

2530
# Build docs with AsciiDoctor
2631
make clean
27-
make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
28-
sed '/^GIT_VERSION = / d' stderr.log
29-
! test -s stderr.log
32+
make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
33+
cat stderr.raw
34+
filter_log stderr.raw >stderr.log
35+
test ! -s stderr.log
3036
test -s Documentation/git.html
3137
grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
3238

33-
rm -f stdout.log stderr.log
39+
rm -f stdout.log stderr.log stderr.raw
3440
check_unignored_build_artifacts
3541

3642
save_good_tree

0 commit comments

Comments
 (0)