Blame


1 20662ea0 2021-04-10 stsp .\"
2 20662ea0 2021-04-10 stsp .\" Copyright (c) 2021 Stefan Sperling
3 20662ea0 2021-04-10 stsp .\"
4 20662ea0 2021-04-10 stsp .\" Permission to use, copy, modify, and distribute this software for any
5 20662ea0 2021-04-10 stsp .\" purpose with or without fee is hereby granted, provided that the above
6 20662ea0 2021-04-10 stsp .\" copyright notice and this permission notice appear in all copies.
7 20662ea0 2021-04-10 stsp .\"
8 20662ea0 2021-04-10 stsp .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 20662ea0 2021-04-10 stsp .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 20662ea0 2021-04-10 stsp .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 20662ea0 2021-04-10 stsp .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 20662ea0 2021-04-10 stsp .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 20662ea0 2021-04-10 stsp .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 20662ea0 2021-04-10 stsp .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 20662ea0 2021-04-10 stsp .\"
16 20662ea0 2021-04-10 stsp .Dd $Mdocdate$
17 20662ea0 2021-04-10 stsp .Dt GOTADMIN 1
18 20662ea0 2021-04-10 stsp .Os
19 20662ea0 2021-04-10 stsp .Sh NAME
20 20662ea0 2021-04-10 stsp .Nm gotadmin
21 20662ea0 2021-04-10 stsp .Nd Game of Trees repository administration
22 20662ea0 2021-04-10 stsp .Sh SYNOPSIS
23 20662ea0 2021-04-10 stsp .Nm
24 20662ea0 2021-04-10 stsp .Ar command
25 20662ea0 2021-04-10 stsp .Op Fl h
26 20662ea0 2021-04-10 stsp .Op Ar arg ...
27 20662ea0 2021-04-10 stsp .Sh DESCRIPTION
28 20662ea0 2021-04-10 stsp .Nm
29 20662ea0 2021-04-10 stsp is the repository maintenance tool for the
30 20662ea0 2021-04-10 stsp .Xr got 1
31 20662ea0 2021-04-10 stsp version control system.
32 20662ea0 2021-04-10 stsp .Pp
33 20662ea0 2021-04-10 stsp .Xr got 1
34 20662ea0 2021-04-10 stsp stores the history of tracked files in a Git repository, as used
35 20662ea0 2021-04-10 stsp by the Git version control system.
36 20662ea0 2021-04-10 stsp .Nm
37 20662ea0 2021-04-10 stsp provides commands for inspecting and manipulating the on-disk state of
38 20662ea0 2021-04-10 stsp Git repositories.
39 20662ea0 2021-04-10 stsp The repository format is described in
40 20662ea0 2021-04-10 stsp .Xr git-repository 5 .
41 20662ea0 2021-04-10 stsp .Pp
42 20662ea0 2021-04-10 stsp .Nm
43 20662ea0 2021-04-10 stsp provides global and command-specific options.
44 20662ea0 2021-04-10 stsp Global options must precede the command name, and are as follows:
45 20662ea0 2021-04-10 stsp .Bl -tag -width tenletters
46 20662ea0 2021-04-10 stsp .It Fl h
47 20662ea0 2021-04-10 stsp Display usage information and exit immediately.
48 20662ea0 2021-04-10 stsp .It Fl V , -version
49 20662ea0 2021-04-10 stsp Display program version and exit immediately.
50 20662ea0 2021-04-10 stsp .El
51 20662ea0 2021-04-10 stsp .Pp
52 20662ea0 2021-04-10 stsp The commands for
53 20662ea0 2021-04-10 stsp .Nm
54 20662ea0 2021-04-10 stsp are as follows:
55 20662ea0 2021-04-10 stsp .Bl -tag -width checkout
56 20662ea0 2021-04-10 stsp .It Cm info Oo Fl r Ar repository-path Oc
57 20662ea0 2021-04-10 stsp Display information about a repository.
58 20662ea0 2021-04-10 stsp This includes some configuration settings from
59 20662ea0 2021-04-10 stsp .Xr got.conf 5 ,
60 20662ea0 2021-04-10 stsp and the number of objects stored in the repository, in packed or
61 20662ea0 2021-04-10 stsp loose form, as well as the current on-disk size of these objects.
62 20662ea0 2021-04-10 stsp .Pp
63 20662ea0 2021-04-10 stsp The options for
64 20662ea0 2021-04-10 stsp .Cm gotadmin info
65 20662ea0 2021-04-10 stsp are as follows:
66 20662ea0 2021-04-10 stsp .Bl -tag -width Ds
67 20662ea0 2021-04-10 stsp .It Fl r Ar repository-path
68 20662ea0 2021-04-10 stsp Use the repository at the specified path.
69 20662ea0 2021-04-10 stsp If not specified, assume the repository is located at or above the current
70 20662ea0 2021-04-10 stsp working directory.
71 20662ea0 2021-04-10 stsp .El
72 05118f5a 2021-06-22 stsp .It Cm pack Oo Fl a Oc Oo Fl r Ar repository-path Oc Oo Fl x Ar reference Oc Op Ar reference ...
73 05118f5a 2021-06-22 stsp Generate a new pack file and a corresponding pack file index.
74 05118f5a 2021-06-22 stsp By default, add any loose objects which are reachable via any references
75 05118f5a 2021-06-22 stsp to the generated pack file.
76 05118f5a 2021-06-22 stsp .Pp
77 05118f5a 2021-06-22 stsp If one or more
78 05118f5a 2021-06-22 stsp .Ar reference
79 05118f5a 2021-06-22 stsp arguments is specified, only add objects which are reachable via the specified
80 05118f5a 2021-06-22 stsp references.
81 05118f5a 2021-06-22 stsp Each
82 05118f5a 2021-06-22 stsp .Ar reference
83 05118f5a 2021-06-22 stsp argument may either specify a specific reference or a reference namespace,
84 05118f5a 2021-06-22 stsp in which case all references within this namespace will be used.
85 05118f5a 2021-06-22 stsp .Pp
86 05118f5a 2021-06-22 stsp .Cm gotadmin pack
87 05118f5a 2021-06-22 stsp always ignores references in the
88 05118f5a 2021-06-22 stsp .Pa refs/got/
89 05118f5a 2021-06-22 stsp namespace, effectively treating such references as if they did not refer
90 05118f5a 2021-06-22 stsp to any objects.
91 05118f5a 2021-06-22 stsp .Pp
92 05118f5a 2021-06-22 stsp The options for
93 05118f5a 2021-06-22 stsp .Cm gotadmin pack
94 05118f5a 2021-06-22 stsp are as follows:
95 05118f5a 2021-06-22 stsp .Bl -tag -width Ds
96 05118f5a 2021-06-22 stsp .It Fl a
97 05118f5a 2021-06-22 stsp Add objects to the generated pack file even if they are already packed
98 05118f5a 2021-06-22 stsp in a different pack file.
99 05118f5a 2021-06-22 stsp Unless this option is specified, only loose objects will be added.
100 05118f5a 2021-06-22 stsp .It Fl r Ar repository-path
101 05118f5a 2021-06-22 stsp Use the repository at the specified path.
102 05118f5a 2021-06-22 stsp If not specified, assume the repository is located at or above the current
103 05118f5a 2021-06-22 stsp working directory.
104 05118f5a 2021-06-22 stsp .It Fl x Ar reference
105 05118f5a 2021-06-22 stsp Exclude objects reachable via the specified
106 05118f5a 2021-06-22 stsp .Ar reference
107 05118f5a 2021-06-22 stsp from the pack file.
108 05118f5a 2021-06-22 stsp The
109 05118f5a 2021-06-22 stsp .Ar reference
110 05118f5a 2021-06-22 stsp argument may either specify a specific reference or a reference namespace,
111 05118f5a 2021-06-22 stsp in which case all references within this namespace will be excluded.
112 05118f5a 2021-06-22 stsp The
113 05118f5a 2021-06-22 stsp .Fl x
114 05118f5a 2021-06-22 stsp option may be specified multiple times to build a list of references to exclude.
115 05118f5a 2021-06-22 stsp .Pp
116 05118f5a 2021-06-22 stsp Exclusion takes precedence over inclusion.
117 05118f5a 2021-06-22 stsp If a reference appears in both the included and excluded lists, it will
118 05118f5a 2021-06-22 stsp be excluded.
119 20662ea0 2021-04-10 stsp .El
120 05118f5a 2021-06-22 stsp .It Cm indexpack Ar packfile-path
121 05118f5a 2021-06-22 stsp Create a pack index for the pack file at
122 05118f5a 2021-06-22 stsp .Ar packfile-path .
123 05118f5a 2021-06-22 stsp .Pp
124 05118f5a 2021-06-22 stsp A pack index is required for using the corresponding pack file with
125 05118f5a 2021-06-22 stsp .Xr got 1 .
126 05118f5a 2021-06-22 stsp Usually, a pack index will be created by commands such as
127 05118f5a 2021-06-22 stsp .Cm gotadmin pack
128 05118f5a 2021-06-22 stsp or
129 05118f5a 2021-06-22 stsp .Cm got fetch
130 05118f5a 2021-06-22 stsp as part of regular operation.
131 05118f5a 2021-06-22 stsp The
132 05118f5a 2021-06-22 stsp .Cm gotadmin indexpack
133 05118f5a 2021-06-22 stsp command may be used to recover from a corrupt or missing index.
134 05118f5a 2021-06-22 stsp A given pack file will always yield the same bit-identical index.
135 05118f5a 2021-06-22 stsp .Pp
136 05118f5a 2021-06-22 stsp The provided
137 05118f5a 2021-06-22 stsp .Ar packfile-path
138 05118f5a 2021-06-22 stsp must be located within the
139 05118f5a 2021-06-22 stsp .Pa objects/pack/
140 05118f5a 2021-06-22 stsp directory of the repository and should end in
141 05118f5a 2021-06-22 stsp .Pa .pack .
142 05118f5a 2021-06-22 stsp The filename of the corresponding pack index is equivalent, except
143 05118f5a 2021-06-22 stsp that it ends in
144 05118f5a 2021-06-22 stsp .Pa .idx .
145 05118f5a 2021-06-22 stsp .Pp
146 05118f5a 2021-06-22 stsp .It Cm ix
147 05118f5a 2021-06-22 stsp Short alias for
148 05118f5a 2021-06-22 stsp .Cm indexpack .
149 05118f5a 2021-06-22 stsp .It Cm listpack Oo Fl h Oc Oo Fl s Oc Ar packfile-path
150 05118f5a 2021-06-22 stsp List the contents of the pack file at
151 05118f5a 2021-06-22 stsp .Ar packfile-path .
152 05118f5a 2021-06-22 stsp .Pp
153 05118f5a 2021-06-22 stsp Each object contained in the pack file will be displayed on a single line.
154 05118f5a 2021-06-22 stsp The information shown includes the object ID, object type, object offset,
155 05118f5a 2021-06-22 stsp and object size.
156 05118f5a 2021-06-22 stsp .Pp
157 05118f5a 2021-06-22 stsp If a packed object is deltified against another object the delta base
158 05118f5a 2021-06-22 stsp will be shown as well.
159 05118f5a 2021-06-22 stsp For offset deltas, the delta base is identified via an offset into the
160 05118f5a 2021-06-22 stsp pack file.
161 05118f5a 2021-06-22 stsp For reference deltas, the delta base is identified via an object ID.
162 05118f5a 2021-06-22 stsp .Pp
163 05118f5a 2021-06-22 stsp The provided
164 05118f5a 2021-06-22 stsp .Ar packfile-path
165 05118f5a 2021-06-22 stsp must be located within the
166 05118f5a 2021-06-22 stsp .Pa objects/pack/
167 05118f5a 2021-06-22 stsp directory of the repository and should end in
168 05118f5a 2021-06-22 stsp .Pa .pack .
169 05118f5a 2021-06-22 stsp .Pp
170 05118f5a 2021-06-22 stsp The options for
171 05118f5a 2021-06-22 stsp .Cm gotadmin listpack
172 05118f5a 2021-06-22 stsp are as follows:
173 05118f5a 2021-06-22 stsp .Bl -tag -width Ds
174 05118f5a 2021-06-22 stsp .It Fl h
175 05118f5a 2021-06-22 stsp Show object sizes in human-readable form.
176 05118f5a 2021-06-22 stsp .It Fl s
177 05118f5a 2021-06-22 stsp Display statistics about the pack file after listing objects.
178 05118f5a 2021-06-22 stsp This includes the total number of objects stored in the pack file
179 05118f5a 2021-06-22 stsp and a break-down of the number of objects per object type.
180 05118f5a 2021-06-22 stsp .El
181 05118f5a 2021-06-22 stsp .It Cm ls
182 05118f5a 2021-06-22 stsp Short alias for
183 05118f5a 2021-06-22 stsp .Cm listpack .
184 ef8ec606 2021-07-27 stsp .It Cm cleanup Oo Fl a Oc Oo Fl p Oc Oo Fl n Oc Oo Fl r Ar repository-path Oc Oo Fl q Oc
185 b3d68e7f 2021-07-03 stsp Purge unreferenced loose objects from the repository and display
186 b3d68e7f 2021-07-03 stsp the amount of disk space which has been freed as a result.
187 b3d68e7f 2021-07-03 stsp .Pp
188 b3d68e7f 2021-07-03 stsp Unreferenced objects are present in the repository but cannot be
189 b3d68e7f 2021-07-03 stsp reached via any reference in the entire
190 b3d68e7f 2021-07-03 stsp .Pa refs/
191 b3d68e7f 2021-07-03 stsp namespace.
192 b3d68e7f 2021-07-03 stsp .Pp
193 b3d68e7f 2021-07-03 stsp Loose objects are stored as individual files beneath the repository's
194 b3d68e7f 2021-07-03 stsp .Pa objects/
195 b3d68e7f 2021-07-03 stsp directory,
196 b3d68e7f 2021-07-03 stsp spread across 256 sub-directories named after the 256 possible
197 b3d68e7f 2021-07-03 stsp hexadecimal values of the first byte of an object identifier.
198 b3d68e7f 2021-07-03 stsp .Pp
199 b3d68e7f 2021-07-03 stsp Packed objects stored in pack files under
200 b3d68e7f 2021-07-03 stsp .Pa objects/pack/
201 b3d68e7f 2021-07-03 stsp will not be purged.
202 b3d68e7f 2021-07-03 stsp However, if redundant copies of packed objects exist in loose form,
203 b3d68e7f 2021-07-03 stsp such redundant copies will be purged.
204 b3d68e7f 2021-07-03 stsp .Pp
205 b3d68e7f 2021-07-03 stsp Objects will usually become unreferenced as a result of deleting
206 b3d68e7f 2021-07-03 stsp branches or tags with
207 b3d68e7f 2021-07-03 stsp .Cm got branch -d
208 b3d68e7f 2021-07-03 stsp or
209 b3d68e7f 2021-07-03 stsp .Cm got tag -d .
210 b3d68e7f 2021-07-03 stsp Deleting arbitrary references with
211 b3d68e7f 2021-07-03 stsp .Cm got ref -d
212 b3d68e7f 2021-07-03 stsp may also leave unreferenced objects behind.
213 b3d68e7f 2021-07-03 stsp .Pp
214 b3d68e7f 2021-07-03 stsp In order to determine the set of objects which are referenced, search
215 b3d68e7f 2021-07-03 stsp all references for commit objects and tag objects, and traverse the
216 b3d68e7f 2021-07-03 stsp corresponding tree object hierarchies.
217 b3d68e7f 2021-07-03 stsp Any loose object IDs not encountered during this search are unreferenced
218 b3d68e7f 2021-07-03 stsp and thus subject to removal.
219 b3d68e7f 2021-07-03 stsp Display the number of commits which have been searched to indicate progress.
220 b3d68e7f 2021-07-03 stsp .Pp
221 b3d68e7f 2021-07-03 stsp References in the
222 b3d68e7f 2021-07-03 stsp .Pa refs/got
223 b3d68e7f 2021-07-03 stsp namespace may prevent objects from being purged.
224 b3d68e7f 2021-07-03 stsp This includes references in the
225 b3d68e7f 2021-07-03 stsp .Pa refs/got/worktree
226 b3d68e7f 2021-07-03 stsp namespace created by
227 b3d68e7f 2021-07-03 stsp .Cm got checkout
228 b3d68e7f 2021-07-03 stsp and
229 b3d68e7f 2021-07-03 stsp .Cm got update ,
230 b3d68e7f 2021-07-03 stsp as well as references in the
231 b3d68e7f 2021-07-03 stsp .Pa refs/got/backup
232 b3d68e7f 2021-07-03 stsp namespace created by
233 b3d68e7f 2021-07-03 stsp .Cm got rebase
234 b3d68e7f 2021-07-03 stsp and
235 b3d68e7f 2021-07-03 stsp .Cm got histedit .
236 b3d68e7f 2021-07-03 stsp .Cm gotadmin cleanup
237 b3d68e7f 2021-07-03 stsp will only purge corresponding objects once such references have been
238 b3d68e7f 2021-07-03 stsp deleted with
239 b3d68e7f 2021-07-03 stsp .Cm got ref -d .
240 9188bd78 2021-07-03 stsp .Pp
241 1124fe40 2021-07-07 stsp Some Git repositories contain pack index files which lack a corresponding
242 1124fe40 2021-07-07 stsp pack file, which is an inconsistent repository state.
243 1124fe40 2021-07-07 stsp In such cases,
244 1124fe40 2021-07-07 stsp .Cm gotadmin cleanup -p -n
245 1124fe40 2021-07-07 stsp will display a list of affected pack index files.
246 1124fe40 2021-07-07 stsp Whenever possible the missing pack files should be restored.
247 1124fe40 2021-07-07 stsp If restoring missing pack files is not possible then affected pack index
248 1124fe40 2021-07-07 stsp files can be removed with
249 1124fe40 2021-07-07 stsp .Cm gotadmin cleanup -p .
250 1124fe40 2021-07-07 stsp .Pp
251 9188bd78 2021-07-03 stsp The
252 9188bd78 2021-07-03 stsp .Dq preciousObjects
253 9188bd78 2021-07-03 stsp Git extension is intended to prevent the removal of objects from a repository.
254 9188bd78 2021-07-03 stsp .Cm gotadmin cleanup
255 9188bd78 2021-07-03 stsp will refuse to operate on repositories where this extension is active.
256 b3d68e7f 2021-07-03 stsp .Pp
257 b3d68e7f 2021-07-03 stsp The options for
258 d4445ca5 2021-07-03 stsp .Cm gotadmin cleanup
259 b3d68e7f 2021-07-03 stsp are as follows:
260 b3d68e7f 2021-07-03 stsp .Bl -tag -width Ds
261 ef8ec606 2021-07-27 stsp .It Fl a
262 ef8ec606 2021-07-27 stsp Delete all loose objects.
263 ef8ec606 2021-07-27 stsp By default, objects which are newer than an implementation-defined
264 ef8ec606 2021-07-27 stsp modification timestamp are kept on disk to prevent race conditions
265 ef8ec606 2021-07-27 stsp with other commands that add new objects to the repository while
266 ef8ec606 2021-07-27 stsp .Cm gotadmin cleanup
267 ef8ec606 2021-07-27 stsp is running.
268 1124fe40 2021-07-07 stsp .It Fl p
269 1124fe40 2021-07-07 stsp Instead of purging unreferenced loose objects, remove any pack index files
270 1124fe40 2021-07-07 stsp which do not have a corresponding pack file.
271 b3d68e7f 2021-07-03 stsp .It Fl n
272 b3d68e7f 2021-07-03 stsp Display the usual progress output and summary information but do not actually
273 1124fe40 2021-07-07 stsp remove any files from disk.
274 b3d68e7f 2021-07-03 stsp .It Fl r Ar repository-path
275 b3d68e7f 2021-07-03 stsp Use the repository at the specified path.
276 b3d68e7f 2021-07-03 stsp If not specified, assume the repository is located at or above the current
277 b3d68e7f 2021-07-03 stsp working directory.
278 b3d68e7f 2021-07-03 stsp .It Fl q
279 b3d68e7f 2021-07-03 stsp Suppress progress reporting and disk space summary output.
280 05118f5a 2021-06-22 stsp .El
281 b3d68e7f 2021-07-03 stsp .It Cm cl
282 b3d68e7f 2021-07-03 stsp Short alias for
283 b3d68e7f 2021-07-03 stsp .Cm cleanup .
284 b3d68e7f 2021-07-03 stsp .El
285 20662ea0 2021-04-10 stsp .Sh EXIT STATUS
286 20662ea0 2021-04-10 stsp .Ex -std gotadmin
287 20662ea0 2021-04-10 stsp .Sh SEE ALSO
288 20662ea0 2021-04-10 stsp .Xr got 1 ,
289 20662ea0 2021-04-10 stsp .Xr tog 1 ,
290 20662ea0 2021-04-10 stsp .Xr git-repository 5 ,
291 20662ea0 2021-04-10 stsp .Xr got.conf 5
292 20662ea0 2021-04-10 stsp .Sh AUTHORS
293 20662ea0 2021-04-10 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
294 05118f5a 2021-06-22 stsp .An Ori Bernstein Aq Mt ori@openbsd.org
295 7e36bc2b 2021-06-25 stsp .Sh CAVEATS
296 7e36bc2b 2021-06-25 stsp .Nm
297 7e36bc2b 2021-06-25 stsp is a work-in-progress and some features remain to be implemented.
298 7e36bc2b 2021-06-25 stsp .Pp
299 7e36bc2b 2021-06-25 stsp At present, the user has to fall back on
300 7e36bc2b 2021-06-25 stsp .Xr git 1
301 7e36bc2b 2021-06-25 stsp to perform some tasks.
302 7e36bc2b 2021-06-25 stsp In particular:
303 7e36bc2b 2021-06-25 stsp .Bl -bullet
304 7e36bc2b 2021-06-25 stsp .It
305 b3d68e7f 2021-07-03 stsp Removing redundant or unreferenced packed objects requires
306 b3d68e7f 2021-07-03 stsp .Xr git-gc 1
307 b3d68e7f 2021-07-03 stsp and perhaps
308 b3d68e7f 2021-07-03 stsp .Xr git-repack 1 .
309 7e36bc2b 2021-06-25 stsp .It
310 7e36bc2b 2021-06-25 stsp Exporting data from repositories requires
311 7e36bc2b 2021-06-25 stsp .Xr git-fast-export 1 .
312 7e36bc2b 2021-06-25 stsp .It
313 7e36bc2b 2021-06-25 stsp Importing data into repositories requires
314 7e36bc2b 2021-06-25 stsp .Xr git-fast-import 1 .
315 7e36bc2b 2021-06-25 stsp .El
316 aaf7c342 2021-07-03 stsp .Sh BUGS
317 aaf7c342 2021-07-03 stsp Disk space savings reported by
318 aaf7c342 2021-07-03 stsp .Cm gotadmin cleanup
319 aaf7c342 2021-07-03 stsp will be misleading if the repository contains object files that were
320 aaf7c342 2021-07-03 stsp hard-linked from another repository.
321 aaf7c342 2021-07-03 stsp Such hard-links will be created by certain
322 aaf7c342 2021-07-03 stsp .Xr git 1
323 aaf7c342 2021-07-03 stsp commands.
324 aaf7c342 2021-07-03 stsp By itself,
325 aaf7c342 2021-07-03 stsp .Xr got 1
326 aaf7c342 2021-07-03 stsp will never create hard-linked object files.