]> Sergey Matveev's repositories - public-inbox.git/blob - Documentation/public-inbox-clone.pod
No ext_urls
[public-inbox.git] / Documentation / public-inbox-clone.pod
1 =head1 NAME
2
3 public-inbox-clone - "git clone --mirror" wrapper
4
5 =head1 SYNOPSIS
6
7 public-inbox-clone INBOX_URL [INBOX_DIR]
8
9 public-inbox-clone ROOT_URL [DESTINATION]
10
11 =head1 DESCRIPTION
12
13 public-inbox-clone is a wrapper around C<git clone --mirror> for
14 making the initial clone of a remote HTTP(S) public-inbox.  It
15 allows cloning multi-epoch v2 inboxes with a single command and
16 zero configuration.
17
18 It does not run L<public-inbox-init(1)> nor
19 L<public-inbox-index(1)>.  Those commands must be run separately
20 if serving/searching the mirror is required.  As-is,
21 public-inbox-clone is suitable for creating a git-only backup.
22
23 public-inbox-clone creates a Makefile with handy targets to update the
24 inbox once indexed.  This Makefile may be edited by the user; it will
25 not be rewritten by L<public-inbox-fetch(1)> unless it is removed
26 completely.
27
28 public-inbox-clone does not use nor require any extra
29 configuration files (not even C<~/.public-inbox/config>).
30
31 L<public-inbox-fetch(1)> may be used to keep C<INBOX_DIR>
32 up-to-date.
33
34 For v2 inboxes, it will create a C<$INBOX_DIR/manifest.js.gz>
35 file to speed up subsequent L<public-inbox-fetch(1)>.
36
37 =head1 OPTIONS
38
39 =over
40
41 =item --epoch=RANGE
42
43 Restrict clones of L<public-inbox-v2-format(5)> inboxes to the
44 given range of epochs.  The range may be a single non-negative
45 integer or a (possibly open-ended) C<LOW..HIGH> range of
46 non-negative integers.  C<~> may be prefixed to either (or both)
47 integer values to represent the offset from the maximum possible
48 value.
49
50 For example, C<--epoch=~0> alone clones only the latest epoch,
51 C<--epoch=~2..> clones the three latest epochs.
52
53 Default: C<0..~0> or C<0..> or C<..~0>
54 (all epochs, all three examples are equivalent)
55
56 =item -I PATTERN
57
58 =item --include=PATTERN
59
60 When cloning a top-level with multiple inboxes, only clone inboxes and
61 repositories matching a given wildcard pattern (using C<*?> and C<[]> is
62 supported).
63
64 =item --exclude=PATTERN
65
66 When cloning a top-level with multiple inboxes, ignore inboxes and
67 repositories matching the given wildcard pattern.  Supports the same
68 wildcards as L</--include>
69
70 =item --inbox-config=always|v2|v1|never
71
72 Whether or not to retrieve the C<$INBOX/_/text/config/raw> HTTP(S)
73 endpoint when cloning.
74
75 Since we can't deduce v1 inboxes from code repositories, setting this
76 to C<v2> or C<never> can allow faster clones of code repositories if
77 no v1 inboxes are present.
78
79 Default: C<always>
80
81 =item --inbox-version=NUM
82
83 Force a remote public-inbox version (must be C<1> or C<2>).
84 This is auto-detected by default, and this option exists mainly
85 for testing.
86
87 =item --objstore=DIR
88
89 Enables space savings when the remote C<manifest.js.gz>
90 includes C<forkgroup> entries as generated by grokmirror 2.x.
91
92 If C<DIR> does not start with C</>, C<./>, or C<../>, it is treated
93 as relative to the C<DESTINATION> directory.  If only C<--objstore=>
94 is specified where C<DIR> is an empty string (C<"">), then C<objstore>
95 (C<$DESTINATION/objstore>) is the implied value of C<DIR>.
96
97 =item --manifest=FILE
98
99 When incrementally updating an existing mirror, load the given
100 manifest (typically C<manifest.js.gz>) to speed up updates.
101
102 By default, public-inbox writes the retrieved manifest to
103 C<$DESTINATION/manifest.js.gz>, this directive also
104 changes the destination to the specified C<FILE>
105
106 If C<FILE> does not start with C</>, C<./>, or C<../>, it is treated
107 as relative to the C<DESTINATION> directory.  If only C<--manifest=>
108 is specified where C<FILE> is an empty string (C<"">), then C<manifest.js.gz>
109 (C<$DESTINATION/manifest.js.gz>) is the implied value of C<FILE>.
110
111 =item --project-list=FILE
112
113 When cloning code repos from a manifest, generate a cgit-compatible
114 project list.
115
116 If C<FILE> does not start with C</>, C<./>, or C<../>, it is treated
117 as relative to the C<DESTINATION> directory.  If only C<--project-list=>
118 is specified where C<FILE> is an empty string (C<"">), then C<projects.list>
119 (C<$DESTINATION/projects.list>) is the implied value of C<FILE>.
120
121 =item --post-update-hook=COMMAND
122
123 Hooks to run after a repository is cloned or updated, C<COMMAND> will
124 have the bare git repository destination given as its first and only
125 argument.
126
127 For v2 inboxes, this operates on a per-epoch basis.
128
129 May be specified multiple times to run multiple commands in the
130 order specified on the command-line.
131
132 =item -p
133
134 =item --prune
135
136 Pass the C<--prune> and C<--prune-tags> flags to L<git-fetch(1)>
137 calls on incremental clones.
138
139 =item --exit-code
140
141 Exit with C<127> if no updates are done when relying on a manifest.
142 Updates include fingerprint mismatches in the manifest, new symlinks,
143 new repositories, and removed repositories from the L<--project-list>
144
145 =item -k
146
147 =item --keep-going
148
149 Continue as much as possible after an error.
150
151 =item -n
152
153 =item --dry-run
154
155 Show what would be done, without making any changes.
156
157 =item -q
158
159 =item --quiet
160
161 Quiets down progress messages, also passed to L<git-fetch(1)>.
162
163 =item -v
164
165 =item --verbose
166
167 Increases verbosity, also passed to L<git-fetch(1)>.
168
169 =item --torsocks=auto|no|yes
170
171 =item --no-torsocks
172
173 Whether to wrap L<git(1)> and L<curl(1)> commands with L<torsocks(1)>.
174
175 Default: C<auto>
176
177 =back
178
179 =head1 CONTACT
180
181 Feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
182
183 The mail archives are hosted at L<https://public-inbox.org/meta/> and
184 L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
185
186 =head1 COPYRIGHT
187
188 Copyright all contributors L<mailto:meta@public-inbox.org>
189
190 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
191
192 =head1 SEE ALSO
193
194 L<public-inbox-fetch(1)>, L<public-inbox-init(1)>, L<public-inbox-index(1)>