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 allowed_signers Pa path
59 Configure a
60 .Ar path
61 to the "allowed signers" file which contains a list of trusted
62 SSH signer identities.
63 The file will be passed to
64 .Xr ssh-keygen 1
65 during verification of SSH-based signatures with
66 .Cm got tag Fl V .
67 The format of the "allowed signers" file is documented in the
68 ALLOWED SIGNERS section of
69 .Xr ssh-keygen 1 .
70 .Pp
71 Verification of SSH-based signatures is impossible unless the
72 .Ic allowed_signers
73 option is set in
74 .Nm .
75 .It Ic revoked_signers Pa path
76 Configure a
77 .Ar path
78 to the optional "revoked signers" file, which contains a list of revoked
79 SSH signer identities.
80 This file is passed to
81 .Xr ssh-keygen 1
82 during signature verification with
83 .Cm got tag Fl V .
84 Revoked identities are no longer considered trustworthy and verification
85 of relevant signatures will fail.
86 .It Ic remote Ar name Brq ...
87 Define a remote repository.
88 The specified
89 .Ar name
90 can be used to refer to the remote repository on the command line of
91 .Cm got fetch
92 and
93 .Cm got send .
94 .Pp
95 Information about this repository is declared in a block of options
96 enclosed in curly brackets:
97 .Bl -tag -width Ds
98 .It Ic server Ar hostname
99 Defines the hostname to use for contacting the remote repository's server.
100 .It Ic repository Ar path
101 Defines the path to the repository on the remote repository's server.
102 .It Ic protocol Ar scheme
103 Defines the protocol to use for communicating with the remote repository's
104 server.
105 .Pp
106 The following protocol schemes are supported:
107 .Bl -tag -width git+ssh
108 .It git
109 The Git protocol as implemented by the
110 .Xr git-daemon 1
111 server.
112 Use of this protocol is discouraged since it supports neither authentication
113 nor encryption.
114 .It git+ssh
115 The Git protocol wrapped in an authenticated and encrypted
116 .Xr ssh 1
117 tunnel.
118 With this protocol the hostname may contain an embedded username for
119 .Xr ssh 1
120 to use:
121 .Mt user@hostname
122 .It ssh
123 Short alias for git+ssh.
124 .El
125 .It Ic port Ar port
126 Defines the port to use for connecting to the remote repository's server.
127 The
128 .Ar port
129 can be specified by number or name.
130 The port name to number mappings are found in the file
131 .Pa /etc/services ;
132 see
133 .Xr services 5
134 for details.
135 If not specified, the default port of the specified
136 .Cm protocol
137 will be used.
138 .It Ic branch Brq Ar branch ...
139 Specify one or more branches which
140 .Cm got fetch
141 and
142 .Cm got send
143 should fetch from and send to the remote repository by default.
144 The list of branches specified here can be overridden at the
145 .Cm got fetch
146 and
147 .Cm got send
148 command lines with the
149 .Fl b
150 option.
151 .It Ic fetch_all_branches Ar yes | no
152 This option controls whether
153 .Cm got fetch
154 will fetch all branches from the remote repository by default.
155 If enabled, this behaviour can be overridden at the
156 .Cm got fetch
157 command line with the
158 .Fl b
159 option, and any
160 .Cm branch
161 configuration settings for this remote repository will be ignored.
162 .It Ic reference Brq Ar reference ...
163 Specify one or more arbitrary references which
164 .Cm got fetch
165 should fetch by default, in addition to the branches and tags that will
166 be fetched.
167 The list of references specified here can be overridden at the
168 .Cm got fetch
169 command line with the
170 .Fl R
171 option.
172 .Cm got fetch
173 will refuse to fetch references from the remote repository's
174 .Dq refs/remotes/
175 or
176 .Dq refs/got/
177 namespace.
178 In any case, references in the
179 .Dq refs/tags/
180 namespace will always be fetched and mapped directly to local references
181 in the same namespace.
182 .It Ic mirror_references Ar yes | no
183 This option controls the behaviour of
184 .Cm got fetch
185 when updating references.
186 .Sy Enabling this option can lead to the loss of local commits.
187 Maintaining custom changes in a mirror repository is therefore discouraged.
188 .Pp
189 If this option is not specified or set to
190 .Ar no ,
191 .Cm got fetch
192 will map references of the remote repository into the local repository's
193 .Dq refs/remotes/
194 namespace.
195 .Pp
196 If this option is set to
197 .Ar yes ,
198 all branches in the
199 .Dq refs/heads/
200 namespace will be updated directly to match the corresponding branches in
201 the remote repository.
202 .It Ic fetch Brq ...
203 An optional
204 .Ic fetch
205 block may contain any of the following configuration settings
206 for use by
207 .Cm got fetch ,
208 overriding corresponding settings in the containing
209 .Ic remote Ar name Brq ...
210 block.
211 .Bl -bullet
212 .It
213 .Ic server Ar hostname
214 .It
215 .Ic repository Ar path
216 .It
217 .Ic protocol Ar scheme
218 .It
219 .Ic port Ar port
220 .It
221 .Ic branch Brq Ar branch ...
222 .El
223 .It Ic send Brq ...
224 An optional
225 .Ic send
226 block may contain any of the following configuration settings
227 for use by
228 .Cm got send ,
229 overriding corresponding settings in the containing
230 .Ic remote Ar name Brq ...
231 block.
232 .Bl -bullet
233 .It
234 .Ic server Ar hostname
235 .It
236 .Ic repository Ar path
237 .It
238 .Ic protocol Ar scheme
239 .It
240 .Ic port Ar port
241 .It
242 .Ic branch Brq Ar branch ...
243 .El
244 .El
245 .El
246 .Sh EXAMPLES
247 Configure author information:
248 .Bd -literal -offset indent
249 author "Flan Hacker <flan_hacker@openbsd.org>"
250 .Ed
251 .Pp
252 Remote repository specification for the Game of Trees repository:
253 .Bd -literal -offset indent
254 remote "origin" {
255 server git.gameoftrees.org
256 protocol git
257 repository got
258 branch { "main" }
260 .Ed
261 .Pp
262 Mirror the
263 .Ox
264 src repository from Github:
265 .Bd -literal -offset indent
266 remote "origin" {
267 repository "openbsd/src"
268 server git@github.com
269 protocol git+ssh
270 mirror_references yes
272 .Ed
273 .Pp
274 Fetch changes via the Git protocol and send changes via the SSH protocol:
275 .Bd -literal -offset indent
276 remote "origin" {
277 repository my_repo
278 server git.example.com
279 protocol git
280 send {
281 server git@git.example.com
282 protocol ssh
285 .Ed
286 .Sh FILES
287 .Bl -tag -width Ds -compact
288 .It Pa got.conf
289 If present,
290 .Nm
291 located in the root directory of a Git repository supersedes any relevant
292 settings in Git's
293 .Pa config
294 file.
295 .Pp
296 .It Pa .got/got.conf
297 If present,
298 .Nm
299 located in the
300 .Pa .got
301 meta-data directory of a
302 .Xr got 1
303 work tree supersedes any relevant settings in the repository's
304 .Nm
305 configuration file and Git's
306 .Pa config
307 file.
308 .El
309 .Sh SEE ALSO
310 .Xr got 1 ,
311 .Xr git-repository 5 ,
312 .Xr got-worktree 5
313 .Sh CAVEATS
314 .Nm
315 offers no way to configure the editor spawned by
316 .Cm got commit ,
317 .Cm got histedit ,
318 .Cm got import ,
319 or
320 .Cm got tag .
321 This is deliberate and prevents potential arbitrary command execution
322 as another user when repositories or work trees are shared between users.
323 Users should set their
324 .Ev VISUAL
325 or
326 .Ev EDITOR
327 environment variables instead.