Skip to content

Commit fe3d8ae

Browse files
committed
doc: convert git-fast-export.adoc to synopsis style
* convert synopsis section * convert options to `` style * convert _<placeholder>_ style * convert inline list of values to sub definition lists Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
1 parent 3d38dbf commit fe3d8ae

2 files changed

Lines changed: 99 additions & 104 deletions

File tree

‎Documentation/git-fast-export.adoc‎

Lines changed: 98 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,57 @@ git-fast-export - Git data exporter
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git fast-export' [<options>] [<revision-range>] [[--] <path>...]
11+
[synopsis]
12+
git fast-export [<options>] [<revision-range>] [[--] <path>...]
1313

1414
DESCRIPTION
1515
-----------
1616
This program dumps the given revisions in a form suitable to be piped
17-
into 'git fast-import'.
17+
into `git fast-import`.
1818

1919
You can use it as a human-readable bundle replacement (see
2020
linkgit:git-bundle[1]), or as a format that can be edited before being
21-
fed to 'git fast-import' in order to do history rewrites (an ability
22-
relied on by tools like 'git filter-repo').
21+
fed to `git fast-import` in order to do history rewrites (an ability
22+
relied on by tools like `git filter-repo`).
2323

2424
OPTIONS
2525
-------
26-
--progress=<n>::
27-
Insert 'progress' statements every <n> objects, to be shown by
28-
'git fast-import' during import.
26+
`--progress=<n>`::
27+
Insert `progress` statements every _<n>_ objects, to be shown by
28+
`git fast-import` during import.
2929

30-
--signed-tags=(verbatim|warn-verbatim|warn-strip|strip|abort)::
30+
`--signed-tags=(verbatim|warn-verbatim|warn-strip|strip|abort)`::
3131
Specify how to handle signed tags. Since any transformation
3232
after the export (or during the export, such as excluding
3333
revisions) can change the hashes being signed, the signatures
3434
may become invalid.
3535
+
36-
When asking to 'abort' (which is the default), this program will die
37-
when encountering a signed tag. With 'strip', the tags will silently
38-
be made unsigned, with 'warn-strip' they will be made unsigned but a
39-
warning will be displayed, with 'verbatim', they will be silently
40-
exported and with 'warn-verbatim' (or 'warn', a deprecated synonym),
41-
they will be exported, but you will see a warning. 'verbatim' and
42-
'warn-verbatim' should only be used if you know that no transformation
36+
`abort`;; Die when encountering a signed tag. This is the default.
37+
`strip`;; Silently make signed tags unsigned.
38+
`warn-strip`;; Make signed tags unsigned and display a warning.
39+
`verbatim`;; Silently export signed tags.
40+
`warn-verbatim` (or `warn`, a deprecated synonym);; Export signed tags and
41+
display a warning.
42+
+
43+
Use `verbatim` and `warn-verbatim` only if you know that no transformation
4344
affecting tags or any commit in their history will be performed by you
44-
or by fast-export or fast-import, or if you do not care that the
45+
or by `git fast-export` or `git fast-import`, or if you do not care that the
4546
resulting tag will have an invalid signature.
4647

47-
--signed-commits=(verbatim|warn-verbatim|warn-strip|strip|abort)::
48+
`--signed-commits=(verbatim|warn-verbatim|warn-strip|strip|abort)`::
4849
Specify how to handle signed commits. Behaves exactly as
49-
'--signed-tags', but for commits. Default is 'strip', which
50+
`--signed-tags`, but for commits. Default is `strip`, which
5051
is the same as how earlier versions of this command without
5152
this option behaved.
5253
+
5354
When exported, a signature starts with:
5455
+
56+
[synopsis]
5557
gpgsig <git-hash-algo> <signature-format>
5658
+
57-
where <git-hash-algo> is the Git object hash so either "sha1" or
58-
"sha256", and <signature-format> is the signature type, so "openpgp",
59-
"x509", "ssh" or "unknown".
59+
where _<git-hash-algo>_ is the Git object hash so either `sha1` or
60+
`sha256`, and _<signature-format>_ is the signature type, so `openpgp`,
61+
`x509`, `ssh` or `unknown`.
6062
+
6163
For example, an OpenPGP signature on a SHA-1 commit starts with
6264
`gpgsig sha1 openpgp`, while an SSH signature on a SHA-256 commit
@@ -70,122 +72,123 @@ Git hash algorithm in each commit.
7072
NOTE: This is highly experimental and the format of the data stream may
7173
change in the future without compatibility guarantees.
7274

73-
--tag-of-filtered-object=(abort|drop|rewrite)::
75+
`--tag-of-filtered-object=(abort|drop|rewrite)`::
7476
Specify how to handle tags whose tagged object is filtered out.
7577
Since revisions and files to export can be limited by path,
7678
tagged objects may be filtered completely.
7779
+
78-
When asking to 'abort' (which is the default), this program will die
79-
when encountering such a tag. With 'drop' it will omit such tags from
80-
the output. With 'rewrite', if the tagged object is a commit, it will
81-
rewrite the tag to tag an ancestor commit (via parent rewriting; see
82-
linkgit:git-rev-list[1]).
83-
84-
-M::
85-
-C::
80+
`abort`;; Die when encountering a tag whose tagged object is filtered out.
81+
This is the default.
82+
`drop`;; Omit filtered tags from the output.
83+
`rewrite`;; Rewrite a tag to tag an ancestor commit if the tagged object is a
84+
commit (via parent rewriting; see linkgit:git-rev-list[1]).
85+
86+
`-M`::
87+
`-C`::
8688
Perform move and/or copy detection, as described in the
8789
linkgit:git-diff[1] manual page, and use it to generate
8890
rename and copy commands in the output dump.
8991
+
9092
Note that earlier versions of this command did not complain and
9193
produced incorrect results if you gave these options.
9294

93-
--export-marks=<file>::
94-
Dumps the internal marks table to <file> when complete.
95+
`--export-marks=<file>`::
96+
Dump the internal marks table to _<file>_ when complete.
9597
Marks are written one per line as `:markid SHA-1`. Only marks
9698
for revisions are dumped; marks for blobs are ignored.
9799
Backends can use this file to validate imports after they
98100
have been completed, or to save the marks table across
99-
incremental runs. As <file> is only opened and truncated
101+
incremental runs. As _<file>_ is only opened and truncated
100102
at completion, the same path can also be safely given to
101-
--import-marks.
103+
`--import-marks`.
102104
The file will not be written if no new object has been
103105
marked/exported.
104106

105-
--import-marks=<file>::
106-
Before processing any input, load the marks specified in
107-
<file>. The input file must exist, must be readable, and
108-
must use the same format as produced by --export-marks.
107+
`--import-marks=<file>`::
108+
Load the marks specified in _<file>_ before processing any input.
109+
The input file must exist, must be readable, and
110+
must use the same format as produced by `--export-marks`.
109111

110-
--mark-tags::
111-
In addition to labelling blobs and commits with mark ids, also
112-
label tags. This is useful in conjunction with
112+
`--mark-tags`::
113+
Label tags with mark ids in addition of blobs and commits.
114+
This is useful in conjunction with
113115
`--export-marks` and `--import-marks`, and is also useful (and
114116
necessary) for exporting of nested tags. It does not hurt
115117
other cases and would be the default, but many fast-import
116118
frontends are not prepared to accept tags with mark
117119
identifiers.
118120
+
119121
Any commits (or tags) that have already been marked will not be
120-
exported again. If the backend uses a similar --import-marks file,
122+
exported again. If the backend uses a similar `--import-marks` file,
121123
this allows for incremental bidirectional exporting of the repository
122124
by keeping the marks the same across runs.
123125

124-
--fake-missing-tagger::
125-
Some old repositories have tags without a tagger. The
126+
`--fake-missing-tagger`::
127+
Fake a tagger for tags from old repositories that do not have one. The
126128
fast-import protocol was pretty strict about that, and did not
127-
allow that. So fake a tagger to be able to fast-import the
129+
allow that. This allows `git fast-import` to import the
128130
output.
129131

130-
--use-done-feature::
131-
Start the stream with a 'feature done' stanza, and terminate
132-
it with a 'done' command.
132+
`--use-done-feature`::
133+
Start the stream with a `feature done` stanza, and terminate
134+
it with a `done` command.
133135

134-
--no-data::
136+
`--no-data`::
135137
Skip output of blob objects and instead refer to blobs via
136138
their original SHA-1 hash. This is useful when rewriting the
137139
directory structure or history of a repository without
138140
touching the contents of individual files. Note that the
139141
resulting stream can only be used by a repository which
140142
already contains the necessary objects.
141143

142-
--full-tree::
143-
This option will cause fast-export to issue a "deleteall"
144+
`--full-tree`::
145+
Issue a `deleteall`
144146
directive for each commit followed by a full list of all files
145147
in the commit (as opposed to just listing the files which are
146148
different from the commit's first parent).
147149

148-
--anonymize::
150+
`--anonymize`::
149151
Anonymize the contents of the repository while still retaining
150152
the shape of the history and stored tree. See the section on
151-
<<ANONYMIZING,`ANONYMIZING`>> below.
152-
153-
--anonymize-map=<from>[:<to>]::
154-
Convert token `<from>` to `<to>` in the anonymized output. If
155-
`<to>` is omitted, map `<from>` to itself (i.e., do not
156-
anonymize it). See the section on <<ANONYMIZING,`ANONYMIZING`>> below.
157-
158-
--reference-excluded-parents::
159-
By default, running a command such as `git fast-export
160-
master~5..master` will not include the commit master{tilde}5
161-
and will make master{tilde}4 no longer have master{tilde}5 as
162-
a parent (though both the old master{tilde}4 and new
163-
master{tilde}4 will have all the same files). Use
164-
--reference-excluded-parents to instead have the stream
165-
refer to commits in the excluded range of history by their
166-
sha1sum. Note that the resulting stream can only be used by a
167-
repository which already contains the necessary parent
153+
<<ANONYMIZING,'ANONYMIZING'>> below.
154+
155+
`--anonymize-map=<from>[:<to>]`::
156+
Convert token _<from>_ to _<to>_ in the anonymized output. If
157+
_<to>_ is omitted, map _<from>_ to itself (i.e., do not
158+
anonymize it). See the section on <<ANONYMIZING,'ANONYMIZING'>> below.
159+
160+
`--reference-excluded-parents`::
161+
Have the stream refer to commits in the excluded range of history by their SHA-1 object
162+
name instead of rewriting their parent references. By default, running
163+
a command such as `git fast-export master~5..master` will not include the
164+
commit `master~5`
165+
and will make `master~4` no longer have `master~5` as
166+
a parent (though both the old `master~4` and new
167+
`master~4` will have all the same files). Note that the resulting stream
168+
can only be used by a repository which already contains the necessary parent
168169
commits.
169170

170-
--show-original-ids::
171+
`--show-original-ids`::
171172
Add an extra directive to the output for commits and blobs,
172173
`original-oid <SHA1SUM>`. While such directives will likely be
173-
ignored by importers such as git-fast-import, it may be useful
174+
ignored by importers such as `git fast-import`, it may be useful
174175
for intermediary filters (e.g. for rewriting commit messages
175176
which refer to older commits, or for stripping blobs by id).
176177

177-
--reencode=(yes|no|abort)::
178+
`--reencode=(yes|no|abort)`::
178179
Specify how to handle `encoding` header in commit objects. When
179-
asking to 'abort' (which is the default), this program will die
180-
when encountering such a commit object. With 'yes', the commit
181-
message will be re-encoded into UTF-8. With 'no', the original
182-
encoding will be preserved.
180+
asking to one of the following values:
181+
+
182+
`abort`;; Die when encountering a commit object with an `encoding` header.
183+
This is the default.
184+
`yes`;; Re-encode the commit message into UTF-8.
185+
`no`;; Preserve the original encoding.
183186

184-
--refspec::
187+
`--refspec`::
185188
Apply the specified refspec to each ref exported. Multiple of them can
186189
be specified.
187190

188-
[<git-rev-list-args>...]::
191+
`<git-rev-list-args>...`::
189192
A list of arguments, acceptable to 'git rev-parse' and
190193
'git rev-list', that specifies the specific objects and references
191194
to export. For example, `master~10..master` causes the
@@ -197,26 +200,26 @@ by keeping the marks the same across runs.
197200
EXAMPLES
198201
--------
199202

200-
-------------------------------------------------------------------
203+
----
201204
$ git fast-export --all | (cd /empty/repository && git fast-import)
202-
-------------------------------------------------------------------
205+
----
203206

204207
This will export the whole repository and import it into the existing
205208
empty repository. Except for reencoding commits that are not in
206209
UTF-8, it would be a one-to-one mirror.
207210

208-
-----------------------------------------------------
211+
----
209212
$ git fast-export master~5..master |
210213
sed "s|refs/heads/master|refs/heads/other|" |
211214
git fast-import
212-
-----------------------------------------------------
215+
----
213216

214-
This makes a new branch called 'other' from 'master~5..master'
215-
(i.e. if 'master' has linear history, it will take the last 5 commits).
217+
This makes a new branch called `other` from `master~5..master`
218+
(i.e. if `master` has linear history, it will take the last 5 commits).
216219

217220
Note that this assumes that none of the blobs and commit messages
218221
referenced by that revision range contains the string
219-
'refs/heads/master'.
222+
`refs/heads/master`.
220223

221224

222225
[[ANONYMIZING]]
@@ -245,30 +248,30 @@ files will be replaced.
245248
If you think you have found a git bug, you can start by exporting an
246249
anonymized stream of the whole repository:
247250

248-
---------------------------------------------------
251+
----
249252
$ git fast-export --anonymize --all >anon-stream
250-
---------------------------------------------------
253+
----
251254

252255
Then confirm that the bug persists in a repository created from that
253256
stream (many bugs will not, as they really do depend on the exact
254257
repository contents):
255258

256-
---------------------------------------------------
259+
----
257260
$ git init anon-repo
258261
$ cd anon-repo
259262
$ git fast-import <../anon-stream
260263
$ ... test your bug ...
261-
---------------------------------------------------
264+
----
262265

263266
If the anonymized repository shows the bug, it may be worth sharing
264267
`anon-stream` along with a regular bug report. Note that the anonymized
265268
stream compresses very well, so gzipping it is encouraged. If you want
266269
to examine the stream to see that it does not contain any private data,
267270
you can peruse it directly before sending. You may also want to try:
268271

269-
---------------------------------------------------
272+
----
270273
$ perl -pe 's/\d+/X/g' <anon-stream | sort -u | less
271-
---------------------------------------------------
274+
----
272275

273276
which shows all of the unique lines (with numbers converted to "X", to
274277
collapse "User 0", "User 1", etc into "User X"). This produces a much
@@ -281,12 +284,12 @@ anonymized. You can ask for a particular token to be left as-is or
281284
mapped to a new value. For example, if you have a bug which reproduces
282285
with `git rev-list sensitive -- secret.c`, you can run:
283286

284-
---------------------------------------------------
287+
----
285288
$ git fast-export --anonymize --all \
286289
--anonymize-map=sensitive:foo \
287290
--anonymize-map=secret.c:bar.c \
288291
>stream
289-
---------------------------------------------------
292+
----
290293

291294
After importing the stream, you can then run `git rev-list foo -- bar.c`
292295
in the anonymized repository.
@@ -303,7 +306,7 @@ final pathname would be `publicdir/bar.c`.
303306
LIMITATIONS
304307
-----------
305308

306-
Since 'git fast-import' cannot tag trees, you will not be
309+
Since `git fast-import` cannot tag trees, you will not be
307310
able to export the linux.git repository completely, as it contains
308311
a tag referencing a tree instead of a commit.
309312

‎Documentation/git-fast-import.adoc‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,16 +1301,8 @@ options the user may specify to git fast-import itself.
13011301
'option' SP <option> LF
13021302
....
13031303

1304-
<<<<<<< HEAD
1305-
The `<option>` part of the command may contain any of the options
1306-
listed in the <<OPTIONS,OPTIONS>> section that do not change import semantics,
1307-
||||||| parent of ef598c93 (doc: convert git-fast-import.adoc to synopsis style)
1308-
The `<option>` part of the command may contain any of the options
1309-
listed in the OPTIONS section that do not change import semantics,
1310-
=======
13111304
The _<option>_ part of the command may contain any of the options
1312-
listed in the OPTIONS section that do not change import semantics,
1313-
>>>>>>> ef598c93 (doc: convert git-fast-import.adoc to synopsis style)
1305+
listed in the <<OPTIONS,OPTIONS>> section that do not change import semantics,
13141306
without the leading `--` and is treated in the same way.
13151307

13161308
Option commands must be the first commands on the input (not counting

0 commit comments

Comments
 (0)