Blob


1 .\"
2 .\" Copyright (c) 2018 Stefan Sperling
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 TOG 1
18 .Os
19 .Sh NAME
20 .Nm tog
21 .Nd git repository browser
22 .Sh SYNOPSIS
23 .Nm
24 .Ar command
25 .Op Fl h
26 .Op Ar arg ...
27 .Sh DESCRIPTION
28 .Nm
29 is an interactive read-only browser for git repositories.
30 This repository format is described in
31 .Xr git-repository 5 .
32 .Pp
33 .Nm
34 supports several types of views which display repository data:
35 .Bl -tag -width Ds
36 .It Log view
37 Displays commits in the repository's history.
38 This view is displayed initially if no
39 .Ar command
40 is specified.
41 .It Diff view
42 Displays changes made in a particular commit.
43 .It Blame view
44 Displays the line-by-line history of a file.
45 .It Tree view
46 Displays the tree corresponding to a particular commit.
47 .El
48 .Pp
49 .Nm
50 provides global and command-specific key bindings and options.
51 The global key bindings are:
52 .Bl -tag -width Ds
53 .It Cm Q
54 Quit
55 .Nm .
56 .It Cm q
57 Quit the view which is in focus.
58 .It Cm Tab
59 Switch focus between views.
60 .It Cm f
61 Toggle fullscreen mode for a split-screen view.
62 .Nm
63 will automatically use split-screen views if the size of the terminal
64 window is sufficiently large.
65 .El
66 .Pp
67 Global options must precede the command name, and are as follows:
68 .Bl -tag -width tenletters
69 .It Fl h
70 Display usage information.
71 .El
72 .Pp
73 The commands for
74 .Nm
75 are as follows:
76 .Bl -tag -width blame
77 .It Cm log [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ path ]
78 Display history of a repository.
79 If a
80 .Ar path
81 is specified, show only commits which modified this path.
82 .Pp
83 This command is also executed if no explicit command is specified.
84 .Pp
85 The key bindings for
86 .Cm tog log
87 are as follows:
88 .Bl -tag -width Ds
89 .It Cm Down-arrow, j, >, Full stop
90 Move the selection cursor down.
91 .It Cm Up-arrow, k, <, Comma
92 Move the selection cursor up.
93 .It Cm Page-down, Ctrl+f
94 Move the selection cursor down one page.
95 .It Cm Page-up, Ctrl+b
96 Move the selection cursor up one page.
97 .It Cm Enter, Space
98 Open a
99 .Cm diff
100 view showing file changes made in the currently selected commit.
101 .It Cm t
102 Open a
103 .Cm tree
104 view showing the tree for the currently selected commit.
105 .It Cm Backspace
106 Show log entries for the parent directory of the currently selected path.
107 .It Cm /
108 Prompt for a search pattern and start searching for matching commits.
109 The search pattern is an extended regular expression which is matched
110 against a commit's author name, committer name, log message, and
111 commit ID SHA1 hash.
112 Regular expression syntax is documented in
113 .Xr re_format 7 .
114 .It Cm n
115 Find the next commit which matches the current search pattern.
116 .It Cm N
117 Find the previous commit which matches the current search pattern.
118 .It Cm Ctrl+l
119 Reload the log view with new commits found in the repository.
120 .El
121 .Pp
122 The options for
123 .Cm tog log
124 are as follows:
125 .Bl -tag -width Ds
126 .It Fl c Ar commit
127 Start traversing history at the specified
128 .Ar commit .
129 The expected argument is the name of a branch or a SHA1 hash which corresponds
130 to a commit object.
131 If this option is not specified, default to the work tree's current branch
132 if invoked in a work tree, or to the repository's HEAD reference.
133 .It Fl r Ar repository-path
134 Use the repository at the specified path.
135 If not specified, assume the repository is located at or above the current
136 working directory.
137 .El
138 .It Cm diff [ Ar repository-path ] Ar object1 Ar object2
139 Display the differences between two objects in the repository.
140 Each
141 .Ar object
142 argument is a SHA1 hash which corresponds to the object.
143 Both objects must be of the same type (blobs, trees, or commits).
144 If the
145 .Ar repository path
146 is omitted, use the current working directory.
147 .Pp
148 The key bindings for
149 .Cm tog diff
150 are as follows:
151 .Bl -tag -width Ds
152 .It Cm Down-arrow, j
153 Scroll down.
154 .It Cm Up-arrow, k
155 Scroll up.
156 .It Cm Page-down, Space, Ctrl+f
157 Scroll down one page.
158 .It Cm Page-up, Ctrl+b
159 Scroll up one page.
160 .It Cm [
161 Reduce the amount of diff context lines.
162 .It Cm ]
163 Increase the amount of diff context lines.
164 .It Cm <, Comma
165 If the diff view was opened via the log view, move to the previous (younger)
166 commit.
167 .It Cm >, Full stop
168 If the diff view was opened via the log view, move to the next (older) commit.
169 .El
170 .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
171 Display line-by-line history of a file at the specified path.
172 .Pp
173 The key bindings for
174 .Cm tog blame
175 are as follows:
176 .Bl -tag -width Ds
177 .It Cm Down-arrow, j, Page-down, Space
178 Move the selection cursor down.
179 .It Cm Up-arrow, k, Page-up
180 Move the selection cursor up.
181 .It Cm Enter
182 Open a
183 .Cm diff
184 view for the currently selected line's commit.
185 .It Cm b
186 Reload the
187 .Cm blame
188 view with the version of the file as found in the currently
189 selected line's commit.
190 .It Cm p
191 Reload the
192 .Cm blame
193 view with the version of the file as found in the parent commit of the
194 currently selected line's commit.
195 .It Cm B
196 Reload the
197 .Cm blame
198 view with the previously blamed commit.
199 .It Cm /
200 Prompt for a search pattern and start searching for matching line.
201 The search pattern is an extended regular expression.
202 Regular expression syntax is documented in
203 .Xr re_format 7 .
204 .It Cm n
205 Find the next line which matches the current search pattern.
206 .It Cm N
207 Find the previous line which matches the current search pattern.
208 .El
209 .Pp
210 The options for
211 .Cm tog blame
212 are as follows:
213 .Bl -tag -width Ds
214 .It Fl c Ar commit
215 Start traversing history at the specified
216 .Ar commit .
217 The expected argument is the name of a branch or a SHA1 hash which corresponds
218 to a commit object.
219 .It Fl r Ar repository-path
220 Use the repository at the specified path.
221 If not specified, assume the repository is located at or above the current
222 working directory.
223 .El
224 .It Cm tree [ Fl c Ar commit ] [ Ar repository-path ]
225 Display the repository tree.
226 If the
227 .Ar repository path
228 is omitted, assume the repository is located in the current working directory.
229 .Pp
230 The key bindings for
231 .Cm tog tree
232 are as follows:
233 .Bl -tag -width Ds
234 .It Cm Down-arrow, j, Page-down
235 Move the selection cursor down.
236 .It Cm Up-arrow, k, Page-up
237 Move the selection cursor up.
238 .It Cm Enter
239 Enter the currently selected directory, or switch to the
240 .Cm blame
241 view for the currently selected file.
242 .It Cm l
243 Open a
244 .Cm log
245 view for the currently selected tree entry.
246 .It Cm Backspace
247 Move back to the parent directory.
248 .It Cm i
249 Show object IDs for all objects displayed in the
250 .Cm tree
251 view.
252 .It Cm /
253 Prompt for a search pattern and start searching for matching tree entries.
254 The search pattern is an extended regular expression which is matched
255 against the tree entry's name.
256 Regular expression syntax is documented in
257 .Xr re_format 7 .
258 .It Cm n
259 Find the next tree entry which matches the current search pattern.
260 .It Cm N
261 Find the previous tree entry which matches the current search pattern.
262 .El
263 .Pp
264 The options for
265 .Cm tog tree
266 are as follows:
267 .Bl -tag -width Ds
268 .It Fl c Ar commit
269 Start traversing history at the specified
270 .Ar commit .
271 The expected argument is the name of a branch or a SHA1 hash which corresponds
272 to a commit object.
273 .El
274 .El
275 .Sh EXIT STATUS
276 .Ex -std tog
277 .Sh SEE ALSO
278 .Xr got 1 ,
279 .Xr git-repository 5 ,
280 .Xr re_format 7
281 .Sh AUTHORS
282 .An Stefan Sperling Aq Mt stsp@openbsd.org
283 .An joshua stein Aq Mt jcs@openbsd.org