Skip to content

Commit 844739b

Browse files
avargitster
authored andcommitted
git docs: add a category for file formats, protocols and interfaces
Create a new "File formats, protocols and other developer interfaces" section in the main "git help git" manual page and start moving the documentation that now lives in "Documentation/technical/*.git" over to it. This complements the newly added and adjacent "Repository, command and file interfaces" section. This makes the technical documentation more accessible and discoverable. Before this we wouldn't install it by default, and had no ability to build man page versions of them. The links to them from our existing documentation link to the generated HTML version of these docs. So let's start moving those over, starting with just the "bundle-format.txt" documentation added in 7378ec9 (doc: describe Git bundle format, 2020-02-07). We'll now have a new gitformat-bundle(5) man page. Subsequent commits will move more git internal format documentation over. Unfortunately the syntax of the current Documentation/technical/*.txt is not the same (when it comes to section headings etc.) as our Documentation/*.txt documentation, so change the relevant bits of syntax as we're moving this over. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d976c51 commit 844739b

File tree

11 files changed

+94
-13
lines changed

11 files changed

+94
-13
lines changed

Documentation/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ MAN1_TXT += gitweb.txt
2424

2525
# man5 / man7 guides (note: new guides should also be added to command-list.txt)
2626
MAN5_TXT += gitattributes.txt
27+
MAN5_TXT += gitformat-bundle.txt
2728
MAN5_TXT += githooks.txt
2829
MAN5_TXT += gitignore.txt
2930
MAN5_TXT += gitmailmap.txt
@@ -95,7 +96,6 @@ TECH_DOCS += MyFirstObjectWalk
9596
TECH_DOCS += SubmittingPatches
9697
TECH_DOCS += ToolsForGit
9798
TECH_DOCS += technical/bitmap-format
98-
TECH_DOCS += technical/bundle-format
9999
TECH_DOCS += technical/cruft-packs
100100
TECH_DOCS += technical/hash-function-transition
101101
TECH_DOCS += technical/http-protocol
@@ -290,6 +290,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
290290
cmds-synchingrepositories.txt \
291291
cmds-synchelpers.txt \
292292
cmds-guide.txt \
293+
cmds-developerinterfaces.txt \
293294
cmds-userinterfaces.txt \
294295
cmds-purehelpers.txt \
295296
cmds-foreignscminterface.txt

Documentation/git-bundle.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ using "thin packs", bundles created using exclusions are smaller in
5656
size. That they're "thin" under the hood is merely noted here as a
5757
curiosity, and as a reference to other documentation.
5858

59-
See link:technical/bundle-format.html[the `bundle-format`
60-
documentation] for more details and the discussion of "thin pack" in
61-
link:technical/pack-format.html[the pack format documentation] for
62-
further details.
59+
See linkgit:gitformat-bundle[5] for more details and the discussion of
60+
"thin pack" in link:technical/pack-format.html[the pack format
61+
documentation] for further details.
6362

6463
OPTIONS
6564
-------
@@ -77,7 +76,7 @@ verify <file>::
7776
commits exist and are fully linked in the current repository.
7877
Then, 'git bundle' prints a list of missing commits, if any.
7978
Finally, information about additional capabilities, such as "object
80-
filter", is printed. See "Capabilities" in link:technical/bundle-format.html
79+
filter", is printed. See "Capabilities" in linkgit:gitformat-bundle[5]
8180
for more information. The exit code is zero for success, but will
8281
be nonzero if the bundle file is invalid.
8382

@@ -337,6 +336,11 @@ You can also see what references it offers:
337336
$ git ls-remote mybundle
338337
----------------
339338

339+
FILE FORMAT
340+
-----------
341+
342+
See linkgit:gitformat-bundle[5].
343+
340344
GIT
341345
---
342346
Part of the linkgit:git[1] suite

Documentation/git-help.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SYNOPSIS
1313
'git help' [-g|--guides]
1414
'git help' [-c|--config]
1515
'git help' [--user-interfaces]
16+
'git help' [--developer-interfaces]
1617

1718
DESCRIPTION
1819
-----------
@@ -83,6 +84,10 @@ user-interface conventions (e.g. linkgit:gitcli[7]), and
8384
pseudo-configuration such as the file-based `.git/hooks/*` interface
8485
described in linkgit:githooks[5].
8586

87+
--developer-interfaces::
88+
Print list of file formats, protocols and other developer
89+
interfaces documentation on the standard output.
90+
8691
-i::
8792
--info::
8893
Display manual page for the command in the 'info' format. The

Documentation/git.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,15 @@ linkgit:git-help[1] for more details on the critera.
348348

349349
include::cmds-userinterfaces.txt[]
350350

351+
File formats, protocols and other developer interfaces
352+
------------------------------------------------------
353+
354+
This documentation discusses file formats, over-the-wire protocols and
355+
other git developer interfaces. See `--developer-interfaces` in
356+
linkgit:git-help[1].
357+
358+
include::cmds-developerinterfaces.txt[]
359+
351360
Configuration Mechanism
352361
-----------------------
353362

Documentation/technical/bundle-format.txt renamed to Documentation/gitformat-bundle.txt

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
1-
= Git bundle v2 format
1+
gitformat-bundle(5)
2+
===================
23

3-
The Git bundle format is a format that represents both refs and Git objects.
4+
NAME
5+
----
6+
gitformat-bundle - The bundle file format
7+
8+
9+
SYNOPSIS
10+
--------
11+
[verse]
12+
*.bundle
13+
*.bdl
14+
15+
DESCRIPTION
16+
-----------
17+
18+
The Git bundle format is a format that represents both refs and Git
19+
objects. A bundle is a header in a format similar to
20+
linkgit:git-show-ref[1] followed by a pack in *.pack format.
421

5-
== Format
22+
The format is created and read by the linkgit:git-bundle[1] command,
23+
and supported by e.g. linkgit:git-fetch[1] and linkgit:git-clone[1].
24+
25+
26+
FORMAT
27+
------
628

729
We will use ABNF notation to define the Git bundle format. See
8-
protocol-common.txt for the details.
30+
link:technical/protocol-common.html for the details.
931

1032
A v2 bundle looks like this:
1133

@@ -36,7 +58,9 @@ value = *(%01-09 / %0b-FF)
3658
pack = ... ; packfile
3759
----
3860

39-
== Semantics
61+
62+
SEMANTICS
63+
---------
4064

4165
A Git bundle consists of several parts.
4266

@@ -62,13 +86,15 @@ In the bundle format, there can be a comment following a prerequisite obj-id.
6286
This is a comment and it has no specific meaning. The writer of the bundle MAY
6387
put any string here. The reader of the bundle MUST ignore the comment.
6488

65-
=== Note on the shallow clone and a Git bundle
89+
Note on the shallow clone and a Git bundle
90+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6691

6792
Note that the prerequisites does not represent a shallow-clone boundary. The
6893
semantics of the prerequisites and the shallow-clone boundaries are different,
6994
and the Git bundle v2 format cannot represent a shallow clone repository.
7095

71-
== Capabilities
96+
CAPABILITIES
97+
------------
7298

7399
Because there is no opportunity for negotiation, unknown capabilities cause 'git
74100
bundle' to abort.
@@ -79,3 +105,7 @@ bundle' to abort.
79105
* `filter` specifies an object filter as in the `--filter` option in
80106
linkgit:git-rev-list[1]. The resulting pack-file must be marked as a
81107
`.promisor` pack-file after it is unbundled.
108+
109+
GIT
110+
---
111+
Part of the linkgit:git[1] suite

Documentation/lint-man-section-order.perl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
'SEE ALSO' => {
3333
order => $order++,
3434
},
35+
'FILE FORMAT' => {
36+
order => $order++,
37+
},
3538
'GIT' => {
3639
required => 1,
3740
order => $order++,

builtin/help.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static enum help_action {
4444
HELP_ACTION_GUIDES,
4545
HELP_ACTION_CONFIG,
4646
HELP_ACTION_USER_INTERFACES,
47+
HELP_ACTION_DEVELOPER_INTERFACES,
4748
HELP_ACTION_CONFIG_FOR_COMPLETION,
4849
HELP_ACTION_CONFIG_SECTIONS_FOR_COMPLETION,
4950
} cmd_mode;
@@ -73,6 +74,9 @@ static struct option builtin_help_options[] = {
7374
OPT_CMDMODE(0, "user-interfaces", &cmd_mode,
7475
N_("print list of user-facing repository, command and file interfaces"),
7576
HELP_ACTION_USER_INTERFACES),
77+
OPT_CMDMODE(0, "developer-interfaces", &cmd_mode,
78+
N_("print list of file formats, protocols and other developer interfaces"),
79+
HELP_ACTION_DEVELOPER_INTERFACES),
7680
OPT_CMDMODE('c', "config", &cmd_mode, N_("print all configuration variable names"),
7781
HELP_ACTION_CONFIG),
7882
OPT_CMDMODE_F(0, "config-for-completion", &cmd_mode, "",
@@ -89,6 +93,7 @@ static const char * const builtin_help_usage[] = {
8993
"git help [-g|--guides]",
9094
"git help [-c|--config]",
9195
"git help [--user-interfaces]",
96+
"git help [--developer-interfaces]",
9297
NULL
9398
};
9499

@@ -663,6 +668,10 @@ int cmd_help(int argc, const char **argv, const char *prefix)
663668
opt_mode_usage(argc, "--user-interfaces", help_format);
664669
list_user_interfaces_help();
665670
return 0;
671+
case HELP_ACTION_DEVELOPER_INTERFACES:
672+
opt_mode_usage(argc, "--developer-interfaces", help_format);
673+
list_developer_interfaces_help();
674+
return 0;
666675
case HELP_ACTION_CONFIG_SECTIONS_FOR_COMPLETION:
667676
opt_mode_usage(argc, "--config-sections-for-completion",
668677
help_format);

command-list.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
# sections 5 and 7. These entries can only have the "userinterfaces"
4949
# attribute and nothing else.
5050
#
51+
# Git's file formats and protocols, such as documentation for the
52+
# *.bundle format lives in man section 5. These entries can only have
53+
# the "developerinterfaces" attribute and nothing else.
54+
#
5155
### command list (do not change this line)
5256
# command name category [category] [category]
5357
git-add mainporcelain worktree
@@ -205,6 +209,7 @@ gitcvs-migration guide
205209
gitdiffcore guide
206210
giteveryday guide
207211
gitfaq guide
212+
gitformat-bundle developerinterfaces
208213
gitglossary guide
209214
githooks userinterfaces
210215
gitignore userinterfaces

help.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ static struct category_description main_categories[] = {
3939
{ CAT_synchingrepositories, N_("Low-level Commands / Syncing Repositories") },
4040
{ CAT_purehelpers, N_("Low-level Commands / Internal Helpers") },
4141
{ CAT_userinterfaces, N_("User-facing repository, command and file interfaces") },
42+
{ CAT_developerinterfaces, N_("Developer-facing file file formats, protocols and interfaces") },
4243
{ 0, NULL }
4344
};
4445

@@ -50,6 +51,7 @@ static const char *drop_prefix(const char *name, uint32_t category)
5051
switch (category) {
5152
case CAT_guide:
5253
case CAT_userinterfaces:
54+
case CAT_developerinterfaces:
5355
prefix = "git";
5456
break;
5557
default:
@@ -445,6 +447,16 @@ void list_user_interfaces_help(void)
445447
putchar('\n');
446448
}
447449

450+
void list_developer_interfaces_help(void)
451+
{
452+
struct category_description catdesc[] = {
453+
{ CAT_developerinterfaces, N_("File formats, protocols and other developer interfaces:") },
454+
{ 0, NULL }
455+
};
456+
print_cmd_by_category(catdesc, NULL);
457+
putchar('\n');
458+
}
459+
448460
static int get_alias(const char *var, const char *value, void *data)
449461
{
450462
struct string_list *list = data;

help.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ void list_common_cmds_help(void);
2323
void list_all_cmds_help(int show_external_commands, int show_aliases);
2424
void list_guides_help(void);
2525
void list_user_interfaces_help(void);
26+
void list_developer_interfaces_help(void);
2627

2728
void list_all_main_cmds(struct string_list *list);
2829
void list_all_other_cmds(struct string_list *list);

0 commit comments

Comments
 (0)