Blob


1 .\"
2 .\" Copyright (c) 2020 Stefan Sperling <stsp@openbsd.org>
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd $Mdocdate$
17 .Dt GOT.CONF 5
18 .Os
19 .Sh NAME
20 .Nm got.conf
21 .Nd Game of Trees configuration file
22 .Sh DESCRIPTION
23 .Nm
24 is the run-time configuration file for
25 .Xr got 1 .
26 .Pp
27 .Nm
28 may be present in the root directory of a Git repository for
29 repository-wide settings, or in the
30 .Pa .got
31 meta-data directory of a work tree to override repository-wide
32 settings for
33 .Xr got 1
34 commands executed within this work tree.
35 .Pp
36 The file format is line-based, with one configuration directive per line.
37 Any lines beginning with a
38 .Sq #
39 are treated as comments and ignored.
40 .Pp
41 The available configuration directives are as follows:
42 .Bl -tag -width Ds
43 .It Ic author Dq Real Name <email address>
44 Configure the author's name and email address for
45 .Cm got commit
46 and
47 .Cm got import
48 when operating on this repository.
49 Author information specified here overrides the
50 .Ev GOT_AUTHOR
51 environment variable.
52 .Pp
53 Because
54 .Xr git 1
55 may fail to parse commits without an email address in author data,
56 .Xr got 1
57 attempts to reject author information with a missing email address.
58 .It Ic signer_id Pa signer-id
59 Configure a
60 .Ar signer-id
61 to sign tag objects.
62 This key will be used to sign all tag objects unless overridden by
63 .Cm got tag Fl s Ar signer-id .
64 .Pp
65 For SSH-based signatures,
66 .Ar signer-id
67 is the path to a file which may refer to either a private SSH key,
68 or a public SSH key with the private half available via
69 .Xr ssh-agent 1 .
70 .It Ic allowed_signers Pa path
71 Configure a
72 .Ar path
73 to the "allowed signers" file which contains a list of trusted
74 SSH signer identities.
75 The file will be passed to
76 .Xr ssh-keygen 1
77 during verification of SSH-based signatures with
78 .Cm got tag Fl V .
79 The format of the "allowed signers" file is documented in the
80 ALLOWED SIGNERS section of
81 .Xr ssh-keygen 1 .
82 .Pp
83 Verification of SSH-based signatures is impossible unless the
84 .Ic allowed_signers
85 option is set in
86 .Nm .
87 .It Ic revoked_signers Pa path
88 Configure a
89 .Ar path
90 to the optional "revoked signers" file, which contains a list of revoked
91 SSH signer identities.
92 This file is passed to
93 .Xr ssh-keygen 1
94 during signature verification with
95 .Cm got tag Fl V .
96 Revoked identities are no longer considered trustworthy and verification
97 of relevant signatures will fail.
98 .It Ic remote Ar name Brq ...
99 Define a remote repository.
100 The specified
101 .Ar name
102 can be used to refer to the remote repository on the command line of
103 .Cm got fetch
104 and
105 .Cm got send .
106 .Pp
107 Information about this repository is declared in a block of options
108 enclosed in curly brackets:
109 .Bl -tag -width Ds
110 .It Ic server Ar hostname
111 Defines the hostname to use for contacting the remote repository's server.
112 .It Ic repository Ar path
113 Defines the path to the repository on the remote repository's server.
114 .It Ic protocol Ar scheme
115 Defines the protocol to use for communicating with the remote repository's
116 server.
117 .Pp
118 The following protocol schemes are supported:
119 .Bl -tag -width git+ssh
120 .It git
121 The Git protocol as implemented by the
122 .Xr git-daemon 1
123 server.
124 Use of this protocol is discouraged since it supports neither authentication
125 nor encryption.
126 .It git+ssh
127 The Git protocol wrapped in an authenticated and encrypted
128 .Xr ssh 1
129 tunnel.
130 With this protocol the hostname may contain an embedded username for
131 .Xr ssh 1
132 to use:
133 .Mt user@hostname
134 .It ssh
135 Short alias for git+ssh.
136 .El
137 .It Ic port Ar port
138 Defines the port to use for connecting to the remote repository's server.
139 The
140 .Ar port
141 can be specified by number or name.
142 The port name to number mappings are found in the file
143 .Pa /etc/services ;
144 see
145 .Xr services 5
146 for details.
147 If not specified, the default port of the specified
148 .Cm protocol
149 will be used.
150 .It Ic branch Brq Ar branch ...
151 Specify one or more branches which
152 .Cm got fetch
153 and
154 .Cm got send
155 should fetch from and send to the remote repository by default.
156 The list of branches specified here can be overridden at the
157 .Cm got fetch
158 and
159 .Cm got send
160 command lines with the
161 .Fl b
162 option.
163 .It Ic fetch_all_branches Ar yes | no
164 This option controls whether
165 .Cm got fetch
166 will fetch all branches from the remote repository by default.
167 If enabled, this behaviour can be overridden at the
168 .Cm got fetch
169 command line with the
170 .Fl b
171 option, and any
172 .Cm branch
173 configuration settings for this remote repository will be ignored.
174 .It Ic reference Brq Ar reference ...
175 Specify one or more arbitrary references which
176 .Cm got fetch
177 should fetch by default, in addition to the branches and tags that will
178 be fetched.
179 The list of references specified here can be overridden at the
180 .Cm got fetch
181 command line with the
182 .Fl R
183 option.
184 .Cm got fetch
185 will refuse to fetch references from the remote repository's
186 .Dq refs/remotes/
187 or
188 .Dq refs/got/
189 namespace.
190 In any case, references in the
191 .Dq refs/tags/
192 namespace will always be fetched and mapped directly to local references
193 in the same namespace.
194 .It Ic mirror_references Ar yes | no
195 This option controls the behaviour of
196 .Cm got fetch
197 when updating references.
198 .Sy Enabling this option can lead to the loss of local commits.
199 Maintaining custom changes in a mirror repository is therefore discouraged.
200 .Pp
201 If this option is not specified or set to
202 .Ar no ,
203 .Cm got fetch
204 will map references of the remote repository into the local repository's
205 .Dq refs/remotes/
206 namespace.
207 .Pp
208 If this option is set to
209 .Ar yes ,
210 all branches in the
211 .Dq refs/heads/
212 namespace will be updated directly to match the corresponding branches in
213 the remote repository.
214 .It Ic fetch Brq ...
215 An optional
216 .Ic fetch
217 block may contain any of the following configuration settings
218 for use by
219 .Cm got fetch ,
220 overriding corresponding settings in the containing
221 .Ic remote Ar name Brq ...
222 block.
223 .Bl -bullet
224 .It
225 .Ic server Ar hostname
226 .It
227 .Ic repository Ar path
228 .It
229 .Ic protocol Ar scheme
230 .It
231 .Ic port Ar port
232 .It
233 .Ic branch Brq Ar branch ...
234 .El
235 .It Ic send Brq ...
236 An optional
237 .Ic send
238 block may contain any of the following configuration settings
239 for use by
240 .Cm got send ,
241 overriding corresponding settings in the containing
242 .Ic remote Ar name Brq ...
243 block.
244 .Bl -bullet
245 .It
246 .Ic server Ar hostname
247 .It
248 .Ic repository Ar path
249 .It
250 .Ic protocol Ar scheme
251 .It
252 .Ic port Ar port
253 .It
254 .Ic branch Brq Ar branch ...
255 .El
256 .El
257 .El
258 .Sh EXAMPLES
259 Configure author information:
260 .Bd -literal -offset indent
261 author "Flan Hacker <flan_hacker@openbsd.org>"
262 .Ed
263 .Pp
264 Remote repository specification for the Game of Trees repository:
265 .Bd -literal -offset indent
266 remote "origin" {
267 server git.gameoftrees.org
268 protocol git
269 repository got
270 branch { "main" }
272 .Ed
273 .Pp
274 Mirror the
275 .Ox
276 src repository from Github:
277 .Bd -literal -offset indent
278 remote "origin" {
279 repository "openbsd/src"
280 server git@github.com
281 protocol git+ssh
282 mirror_references yes
284 .Ed
285 .Pp
286 Fetch changes via the Git protocol and send changes via the SSH protocol:
287 .Bd -literal -offset indent
288 remote "origin" {
289 repository my_repo
290 server git.example.com
291 protocol git
292 send {
293 server git@git.example.com
294 protocol ssh
297 .Ed
298 .Sh FILES
299 .Bl -tag -width Ds -compact
300 .It Pa got.conf
301 If present,
302 .Nm
303 located in the root directory of a Git repository supersedes any relevant
304 settings in Git's
305 .Pa config
306 file.
307 .Pp
308 .It Pa .got/got.conf
309 If present,
310 .Nm
311 located in the
312 .Pa .got
313 meta-data directory of a
314 .Xr got 1
315 work tree supersedes any relevant settings in the repository's
316 .Nm
317 configuration file and Git's
318 .Pa config
319 file.
320 .El
321 .Sh SEE ALSO
322 .Xr got 1 ,
323 .Xr git-repository 5 ,
324 .Xr got-worktree 5
325 .Sh CAVEATS
326 .Nm
327 offers no way to configure the editor spawned by
328 .Cm got commit ,
329 .Cm got histedit ,
330 .Cm got import ,
331 or
332 .Cm got tag .
333 This is deliberate and prevents potential arbitrary command execution
334 as another user when repositories or work trees are shared between users.
335 Users should set their
336 .Ev VISUAL
337 or
338 .Ev EDITOR
339 environment variables instead.