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 remote Ar name Brq ...
59 Define a remote repository.
60 The specified
61 .Ar name
62 can be used to refer to the remote repository on the command line of
63 .Cm got fetch .
64 .Pp
65 Information about this repository is declared in a block of options
66 enclosed in curly brackets:
67 .Bl -tag -width Ds
68 .It Ic server Ar hostname
69 Defines the hostname to use for contacting the remote repository's server.
70 .It Ic repository Ar path
71 Defines the path to the repository on the remote repository's server.
72 .It Ic protocol Ar scheme
73 Defines the protocol to use for communicating with the remote repository's
74 server.
75 .Pp
76 The following protocol schemes are supported:
77 .Bl -tag -width git+ssh
78 .It git
79 The Git protocol as implemented by the
80 .Xr git-daemon 1
81 server.
82 Use of this protocol is discouraged since it supports neither authentication
83 nor encryption.
84 .It git+ssh
85 The Git protocol wrapped in an authenticated and encrypted
86 .Xr ssh 1
87 tunnel.
88 With this protocol the hostname may contain an embedded username for
89 .Xr ssh 1
90 to use:
91 .Mt user@hostname
92 .It ssh
93 Short alias for git+ssh.
94 .El
95 .It Ic port Ar port
96 Defines the port to use for connecting to the remote repository's server.
97 The
98 .Ar port
99 can be specified by number or name.
100 The port name to number mappings are found in the file
101 .Pa /etc/services ;
102 see
103 .Xr services 5
104 for details.
105 If not specified, the default port of the specified
106 .Cm protocol
107 will be used.
108 .It Ic branch Brq Ar branch ...
109 Specify one or more branches which
110 .Cm got fetch
111 should fetch from the remote repository by default.
112 The list of branches specified here can be overridden at the
113 .Cm got fetch
114 command line with the
115 .Fl b
116 option.
117 .It Ic fetch-all-branches Ar yes | no
118 This option controls whether
119 .Cm got fetch
120 will fetch all branches from the remote repository by default.
121 If enabled, this behaviour can be overridden at the
122 .Cm got fetch
123 command line with the
124 .Fl b
125 option, and any
126 .Cm branch
127 configuration settings for this remote repository will be ignored.
128 .It Ic reference Brq Ar reference ...
129 Specify one or more arbitrary references which
130 .Cm got fetch
131 should fetch by default, in addition to the branches and tags that will
132 be fetched.
133 The list of references specified here can be overridden at the
134 .Cm got fetch
135 command line with the
136 .Fl R
137 option.
138 .Cm got fetch
139 will refuse to fetch references from the remote repository's
140 .Dq refs/remotes/
141 or
142 .Dq refs/got/
143 namespace.
144 In any case, references in the
145 .Dq refs/tags/
146 namespace will always be fetched and mapped directly to local references
147 in the same namespace.
148 .It Ic mirror-references Ar yes | no
149 This option controls the behaviour of
150 .Cm got fetch
151 when updating references.
152 .Sy Enabling this option can lead to the loss of local commits.
153 Maintaining custom changes in a mirror repository is therefore discouraged.
154 .Pp
155 If this option is not specified or set to
156 .Ar no ,
157 .Cm got fetch
158 will map references of the remote repository into the local repository's
159 .Dq refs/remotes/
160 namespace.
161 .Pp
162 If this option is set to
163 .Ar yes ,
164 all branches in the
165 .Dq refs/heads/
166 namespace will be updated directly to match the corresponding branches in
167 the remote repository.
168 .El
169 .El
170 .Sh EXAMPLES
171 Configure author information:
172 .Bd -literal -offset indent
173 author "Flan Hacker <flan_hacker@openbsd.org>"
174 .Ed
175 .Pp
176 Remote repository specification for the Game of Trees repository:
177 .Bd -literal -offset indent
178 remote "origin" {
179 server git.gameoftrees.org
180 protocol git
181 repository got
182 branch { "main" }
184 .Ed
185 .Pp
186 Mirror the
187 .Ox
188 src repository from Github:
189 .Bd -literal -offset indent
190 remote "origin" {
191 repository "openbsd/src"
192 server git@github.com
193 protocol git+ssh
194 mirror-references yes
196 .Ed
197 .Sh FILES
198 .Bl -tag -width Ds -compact
199 .It Pa got.conf
200 If present,
201 .Nm
202 located in the root directory of a Git repository supersedes any relevant
203 settings in Git's
204 .Pa config
205 file.
206 .Pp
207 .It Pa .got/got.conf
208 If present,
209 .Nm
210 located in the
211 .Pa .got
212 meta-data directory of a
213 .Xr got 1
214 work tree supersedes any relevant settings in the repository's
215 .Nm
216 configuration file and Git's
217 .Pa config
218 file.
219 .El
220 .Sh SEE ALSO
221 .Xr got 1 ,
222 .Xr git-repository 5 ,
223 .Xr got-worktree 5
224 .Sh CAVEATS
225 .Nm
226 offers no way to configure the editor spawned by
227 .Cm got commit ,
228 .Cm got histedit ,
229 .Cm got import ,
230 or
231 .Cm got tag .
232 This is deliberate and prevents potential arbitrary command execution
233 as another user when repositories or work trees are shared between users.
234 Users should set their
235 .Ev VISUAL
236 or
237 .Ev EDITOR
238 environment variables instead.