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 .Op Fl hV
25 .Ar command
26 .Op Ar arg ...
27 .Pp
28 .Nm
29 .Ar path
30 .Sh DESCRIPTION
31 .Nm
32 is an interactive read-only browser for Git repositories.
33 This repository format is described in
34 .Xr git-repository 5 .
35 .Pp
36 .Nm
37 supports several types of views which display repository data:
38 .Bl -tag -width Ds
39 .It Log view
40 Displays commits in the repository's history.
41 This view is displayed initially if no
42 .Ar command
43 is specified, or if just a
44 .Ar path
45 is specified.
46 .It Diff view
47 Displays changes made in a particular commit.
48 .It Blame view
49 Displays the line-by-line history of a file.
50 .It Tree view
51 Displays the tree corresponding to a particular commit.
52 .It Ref view
53 Displays references in the repository.
54 .El
55 .Pp
56 .Nm
57 provides global and command-specific key bindings and options.
58 Some command-specific key bindings may be prefixed with an integer, which is
59 denoted by N in the descriptions below, and is used as a modifier to the
60 operation as indicated.
61 .Nm
62 will echo digits to the screen when count modifiers are entered, and complete
63 the sequence upon input of the first non-numeric character.
64 Count modifiers can be aborted by entering an unmapped key.
65 Once a compound command is executed, the operation can be cancelled with
66 .Cm C-g
67 or
68 .Cm Backspace .
69 .Pp
70 Global options must precede the command name, and are as follows:
71 .Bl -tag -width tenletters
72 .It Fl h
73 Display usage information.
74 .It Fl V , -version
75 Display program version and exit immediately.
76 .El
77 .Pp
78 The global key bindings are:
79 .Bl -tag -width Ds
80 .It Cm H, F1
81 Display run-time help.
82 Key bindings for the focussed view will be displayed.
83 Pressing this again inside the help view will toggle the display of
84 key bindings for all
85 .Nm
86 views.
87 .It Cm Q
88 Quit
89 .Nm .
90 .It Cm q
91 Quit the view which is in focus.
92 .It Cm Tab
93 Switch focus between views.
94 .It Cm F
95 Toggle fullscreen mode for a split-screen view.
96 .Nm
97 will automatically use vertical split-screen views if the size of the
98 terminal window is sufficiently large.
99 .It Cm S
100 Switch the current split-screen layout, and render all active views in
101 this new layout.
102 The split-screen layout can be either vertical or horizontal.
103 If the terminal is not wide enough when switching to a vertical split,
104 views will render in fullscreen.
105 .It Cm -
106 When in a split-screen view, decrease the size of the focussed split
107 N increments (default: 1).
108 .It Cm +
109 When in a split-screen view, increase the size of the focussed split
110 N increments (default: 1).
111 .It Cm G
112 Go to line N in the view (default: last line).
113 .It Cm g
114 Go to line N in the view (default: first line).
115 .It Cm Right-arrow, l
116 Scroll view to the right N increments (default: 1).
117 .br
118 Output moves left on the screen.
119 .It Cm Left-arrow, h
120 Scroll view to the left N increments (default: 1).
121 .br
122 Output moves right on the screen.
123 .It Cm $
124 Scroll view to the rightmost position.
125 .It Cm 0
126 Scroll view left to the start of the line.
127 .El
128 .Pp
129 The commands for
130 .Nm
131 are as follows:
132 .Bl -tag -width blame
133 .It Xo
134 .Cm log
135 .Op Fl b
136 .Op Fl c Ar commit
137 .Op Fl r Ar repository-path
138 .Op Ar path
139 .Xc
140 Display history of a repository.
141 If a
142 .Ar path
143 is specified, show only commits which modified this path.
144 If invoked in a work tree, the
145 .Ar path
146 is interpreted relative to the current working directory,
147 and the work tree's path prefix is implicitly prepended.
148 Otherwise, the path is interpreted relative to the repository root.
149 .Pp
150 This command is also executed if no explicit command is specified.
151 .Pp
152 The key bindings for
153 .Cm tog log
154 are as follows (N denotes optional prefixed count modifier):
155 .Bl -tag -width Ds
156 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
157 Move the selection cursor down N lines (default: 1).
158 .It Cm Up-arrow, k, <, Comma, Ctrl-p
159 Move the selection cursor up N lines (default: 1).
160 .It Cm Page-down, Space, Ctrl+f, f
161 Move the selection cursor down N pages (default: 1).
162 .It Cm Page-up, Ctrl+b, b
163 Move the selection cursor up N pages (default: 1).
164 .It Cm Ctrl+d, d
165 Move the selection cursor down N half pages (default: 1).
166 .It Cm Ctrl+u, u
167 Move the selection cursor up N half pages (default: 1).
168 .It Cm Home, =
169 Move the cursor to the newest commit.
170 .It Cm End, *
171 Move the cursor to the oldest commit.
172 This will traverse all commits on the current branch which may take
173 a long time depending on the number of commits in branch history.
174 If needed, this operation can be cancelled with
175 .Cm C-g
176 or
177 .Cm Backspace .
178 .It Cm g
179 Move the cursor to commit N (default: 1).
180 .It Cm G
181 Like
182 .Cm g
183 but defaults to the oldest commit.
184 .It Cm Enter
185 Open a
186 .Cm diff
187 view showing file changes made in the currently selected commit.
188 .It Cm T
189 Open a
190 .Cm tree
191 view showing the tree for the currently selected commit.
192 .It Cm Backspace
193 Show log entries for the parent directory of the currently selected path.
194 However when an active search is in progress or when additional commits
195 are loaded,
196 .Cm Backspace
197 aborts the running operation.
198 .It Cm /
199 Prompt for a search pattern and start searching for matching commits.
200 The search pattern is an extended regular expression which is matched
201 against a commit's author name, committer name, log message, and
202 commit ID SHA1 hash.
203 Regular expression syntax is documented in
204 .Xr re_format 7 .
205 .It Cm &
206 Prompt for a pattern and limit the log view's list of commits to those
207 which match the pattern.
208 If no pattern is specified, i.e. the
209 .Cm &
210 prompt is immediately closed with the Enter key, then the pattern is
211 cleared.
212 Until the pattern is cleared, the limited list of commits replaces the
213 full list of commits for all operations supported by the log view.
214 For example, a search started with
215 .Cm /
216 will search the limited list of commits, rather than searching all commits.
217 The pattern is an extended regular expression which is matched
218 against a commit's author name, committer name, log message, and
219 commit ID SHA1 hash.
220 Regular expression syntax is documented in
221 .Xr re_format 7 .
222 .It Cm n
223 Find the Nth next commit which matches the current search pattern (default: 1).
224 .br
225 Searching continues until either a match is found or
226 .Cm C-g
227 or the
228 .Cm Backspace
229 key is pressed.
230 .It Cm N
231 Find the Nth previous commit which matches the current search pattern
232 (default: 1).
233 .br
234 Searching continues until either a match is found or
235 .Cm C-g
236 or the
237 .Cm Backspace
238 key is pressed.
239 .It Cm Ctrl+l
240 Reload the
241 .Cm log
242 view with new commits found in the repository.
243 .It Cm B
244 Reload the
245 .Cm log
246 view and toggle display of merged commits.
247 The
248 .Fl b
249 option determines whether merged commits are displayed initially.
250 .It Cm R
251 Open a
252 .Cm ref
253 view listing all references in the repository.
254 This can then be used to open a new
255 .Cm log
256 view for arbitrary branches and tags.
257 .It Cm @
258 Toggle between showing the committer name and the author name.
259 .El
260 .Pp
261 The options for
262 .Cm tog log
263 are as follows:
264 .Bl -tag -width Ds
265 .It Fl b
266 Display individual commits which were merged into the current branch
267 from other branches.
268 By default,
269 .Cm tog log
270 shows the linear history of the current branch only.
271 The
272 .Cm B
273 key binding can be used to toggle display of merged commits at run-time.
274 .It Fl c Ar commit
275 Start traversing history at the specified
276 .Ar commit .
277 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
278 which will be resolved to a commit ID.
279 An abbreviated hash argument will be expanded to a full SHA1 hash
280 automatically, provided the abbreviation is unique.
281 The keywords
282 .Qq :base
283 and
284 .Qq :head
285 resolve to the work tree's base commit and branch head, respectively.
286 The former is only valid if invoked in a work tree, while the latter will
287 resolve to the tip of the work tree's current branch if invoked in a
288 work tree, otherwise it will resolve to the repository's HEAD reference.
289 Keywords and references may be appended with
290 .Qq :+
291 or
292 .Qq :-
293 modifiers and an optional integer N to denote the
294 Nth descendant or antecedent by first parent traversal, respectively;
295 for example,
296 .Sy :head:-2
297 denotes the work tree branch head's 2nd generation ancestor, and
298 .Sy :base:+4
299 denotes the 4th generation descendant of the work tree's base commit.
300 Similarly,
301 .Sy foobar:+3
302 will denote the 3rd generation descendant of the commit resolved by the
303 .Qq foobar
304 reference.
306 .Qq :+
307 or
308 .Qq :-
309 modifier without a trailing integer has an implicit
310 .Qq 1
311 appended
312 .Po e.g.,
313 .Sy :base:+
314 is equivalent to
315 .Sy :base:+1
316 .Pc .
317 .It Fl r Ar repository-path
318 Use the repository at the specified path.
319 If not specified, assume the repository is located at or above the current
320 working directory.
321 If this directory is a
322 .Xr got 1
323 work tree, use the repository path associated with this work tree.
324 .El
325 .It Xo
326 .Cm diff
327 .Op Fl aw
328 .Op Fl C Ar number
329 .Op Fl r Ar repository-path
330 .Ar object1
331 .Ar object2
332 .Xc
333 Display the differences between two objects in the repository.
334 Treat each of the two arguments as a reference, a tag name, an object
335 ID SHA1 hash, or a keyword and display differences between the corresponding
336 objects.
337 Both objects must be of the same type (blobs, trees, or commits).
338 An abbreviated hash argument will be expanded to a full SHA1 hash
339 automatically, provided the abbreviation is unique.
340 The keywords
341 .Qq :base
342 and
343 .Qq :head
344 resolve to the work tree's base commit and branch head, respectively.
345 The former is only valid if invoked in a work tree, while the latter will
346 resolve to the tip of the work tree's current branch if invoked in a
347 work tree, otherwise it will resolve to the repository's HEAD reference.
348 Keywords and references may be appended with
349 .Qq :+
350 or
351 .Qq :-
352 modifiers and an optional integer N to denote the
353 Nth descendant or antecedent by first parent traversal, respectively;
354 for example,
355 .Sy :head:-2
356 denotes the work tree branch head's 2nd generation ancestor, and
357 .Sy :base:+4
358 denotes the 4th generation descendant of the work tree's base commit.
359 Similarly,
360 .Sy foobar:+3
361 will denote the 3rd generation descendant of the commit resolved by the
362 .Qq foobar
363 reference.
365 .Qq :+
366 or
367 .Qq :-
368 modifier without a trailing integer has an implicit
369 .Qq 1
370 appended
371 .Po e.g.,
372 .Sy :base:+
373 is equivalent to
374 .Sy :base:+1
375 .Pc .
376 .Pp
377 The key bindings for
378 .Cm tog diff
379 are as follows (N denotes optional prefixed count modifier):
380 .Bl -tag -width Ds
381 .It Cm a
382 Toggle treatment of file contents as ASCII text even if binary data was
383 detected.
384 .It Cm Down-arrow, j, Ctrl-n
385 Scroll down N lines (default: 1).
386 .It Cm Up-arrow, k, Ctrl-p
387 Scroll up N lines (default: 1).
388 .It Cm Page-down, Space, Ctrl+f, f
389 Scroll down N pages (default: 1).
390 .It Cm Page-up, Ctrl+b, b
391 Scroll up N pages (default: 1).
392 .It Cm Ctrl+d, d
393 Scroll down N half pages (default: 1).
394 .It Cm Ctrl+u, u
395 Scroll up N half pages (default: 1).
396 .It Cm Home
397 Scroll to the top of the view.
398 .It Cm End
399 Scroll to the bottom of the view.
400 .It Cm g
401 Scroll to line N (default: 1).
402 .It Cm G
403 Like
404 .Cm g
405 but defaults to the last line in the diff.
406 .It Cm \&(
407 Navigate to the Nth previous file in the diff (default: 1).
408 .It Cm \&)
409 Navigate to the Nth next file in the diff (default: 1).
410 .It Cm \&{
411 Navigate to the Nth previous hunk in the diff (default: 1).
412 .It Cm \&}
413 Navigate to the Nth next hunk in the diff (default: 1).
414 .It Cm \&[
415 Reduce diff context by N lines (default: 1).
416 .It Cm \&]
417 Increase diff context by N lines (default: 1).
418 .It Cm <, Comma, K
419 If the
420 .Cm diff
421 view was opened via the
422 .Cm log
423 view, move to the Nth previous (younger) commit.
424 If the diff was opened via the
425 .Cm blame
426 view, move to the Nth previous line and load the corresponding commit
427 (default: 1).
428 .It Cm >, Full stop, J
429 If the
430 .Cm diff
431 view was opened via the
432 .Cm log
433 view, move to the Nth next (older) commit.
434 If the diff was opened via the
435 .Cm blame
436 view, move to the Nth next line and load the corresponding commit (default: 1).
437 .It Cm /
438 Prompt for a search pattern and start searching for matching lines.
439 The search pattern is an extended regular expression.
440 Regular expression syntax is documented in
441 .Xr re_format 7 .
442 .It Cm n
443 Find the Nth next line which matches the current search pattern (default: 1).
444 .It Cm N
445 Find the Nth previous line which matches the current search pattern
446 (default: 1).
447 .It Cm w
448 Toggle display of whitespace-only changes.
449 .It Cm A
450 Change the diff algorithm.
451 Supported diff algorithms are Myers (quick and dirty) and
452 Patience (slow and tidy).
453 This is a global setting which also affects the
454 .Cm blame
455 view.
456 .El
457 .Pp
458 The options for
459 .Cm tog diff
460 are as follows:
461 .Bl -tag -width Ds
462 .It Fl a
463 Treat file contents as ASCII text even if binary data is detected.
464 .It Fl C Ar number
465 Set the number of context lines shown in the diff.
466 By default, 3 lines of context are shown.
467 .It Fl r Ar repository-path
468 Use the repository at the specified path.
469 If not specified, assume the repository is located at or above the current
470 working directory.
471 If this directory is a
472 .Xr got 1
473 work tree, use the repository path associated with this work tree.
474 .It Fl w
475 Ignore whitespace-only changes.
476 .El
477 .It Xo
478 .Cm blame
479 .Op Fl c Ar commit
480 .Op Fl r Ar repository-path
481 .Ar path
482 .Xc
483 Display line-by-line history of a file at the specified path.
484 .Pp
485 The key bindings for
486 .Cm tog blame
487 are as follows (N denotes optional prefixed count modifier):
488 .Bl -tag -width Ds
489 .It Cm Down-arrow, j, Ctrl-n
490 Move the selection cursor down N pages (default: 1).
491 .It Cm Up-arrow, k, Ctrl-p
492 Move the selection cursor up N pages (default: 1).
493 .It Cm Page-down, Space, Ctrl+f, f
494 Move the selection cursor down N pages (default: 1).
495 .It Cm Page-up, Ctrl+b, b
496 Move the selection cursor up N pages (default: 1).
497 .It Cm Ctrl+d, d
498 Move the selection cursor down N half pages (default: 1).
499 .It Cm Ctrl+u, u
500 Move the selection cursor up N half pages (default: 1).
501 .It Cm Home
502 Move the selection cursor to the first line of the file.
503 .It Cm End
504 Move the selection cursor to the last line of the file.
505 .It Cm g
506 Move the selection cursor to line N (default: 1).
507 .It Cm G
508 Like
509 .Cm g
510 but defaults to the last line in the file.
511 .It Cm Enter
512 Open a
513 .Cm diff
514 view for the currently selected line's commit.
515 .It Cm c
516 Reload the
517 .Cm blame
518 view with the version of the file as found in the currently
519 selected line's commit.
520 .It Cm p
521 Reload the
522 .Cm blame
523 view with the version of the file as found in the parent commit of the
524 currently selected line's commit.
525 .It Cm C
526 Reload the
527 .Cm blame
528 view with the previously blamed commit.
529 .It Cm L
530 Open a
531 .Cm log
532 view for the currently selected annotated line.
533 .It Cm /
534 Prompt for a search pattern and start searching for matching lines.
535 The search pattern is an extended regular expression.
536 Regular expression syntax is documented in
537 .Xr re_format 7 .
538 .It Cm n
539 Find the Nth next line which matches the current search pattern (default: 1).
540 .It Cm N
541 Find the Nth previous line which matches the current search pattern
542 (default: 1).
543 .It Cm A
544 Change the diff algorithm.
545 Supported diff algorithms are Myers (quick and dirty) and
546 Patience (slow and tidy).
547 This is a global setting which also affects the
548 .Cm diff
549 view.
550 .El
551 .Pp
552 The options for
553 .Cm tog blame
554 are as follows:
555 .Bl -tag -width Ds
556 .It Fl c Ar commit
557 Start traversing history at the specified
558 .Ar commit .
559 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
560 which will be resolved to a commit ID.
561 An abbreviated hash argument will be expanded to a full SHA1 hash
562 automatically, provided the abbreviation is unique.
563 The keywords
564 .Qq :base
565 and
566 .Qq :head
567 resolve to the work tree's base commit and branch head, respectively.
568 The former is only valid if invoked in a work tree, while the latter will
569 resolve to the tip of the work tree's current branch if invoked in a
570 work tree, otherwise it will resolve to the repository's HEAD reference.
571 Keywords and references may be appended with
572 .Qq :+
573 or
574 .Qq :-
575 modifiers and an optional integer N to denote the
576 Nth descendant or antecedent by first parent traversal, respectively;
577 for example,
578 .Sy :head:-2
579 denotes the work tree branch head's 2nd generation ancestor, and
580 .Sy :base:+4
581 denotes the 4th generation descendant of the work tree's base commit.
582 Similarly,
583 .Sy foobar:+3
584 will denote the 3rd generation descendant of the commit resolved by the
585 .Qq foobar
586 reference.
588 .Qq :+
589 or
590 .Qq :-
591 modifier without a trailing integer has an implicit
592 .Qq 1
593 appended
594 .Po e.g.,
595 .Sy :base:+
596 is equivalent to
597 .Sy :base:+1
598 .Pc .
599 .It Fl r Ar repository-path
600 Use the repository at the specified path.
601 If not specified, assume the repository is located at or above the current
602 working directory.
603 If this directory is a
604 .Xr got 1
605 work tree, use the repository path associated with this work tree.
606 .El
607 .It Xo
608 .Cm tree
609 .Op Fl c Ar commit
610 .Op Fl r Ar repository-path
611 .Op Ar path
612 .Xc
613 Display the repository tree.
614 If a
615 .Ar path
616 is specified, show tree entries at this path.
617 .Pp
618 Displayed tree entries may carry one of the following trailing annotations:
619 .Bl -column YXZ description
620 .It @ Ta entry is a symbolic link
621 .It / Ta entry is a directory
622 .It * Ta entry is an executable file
623 .It $ Ta entry is a Git submodule
624 .El
625 .Pp
626 Symbolic link entries are also annotated with the target path of the link.
627 .Pp
628 The key bindings for
629 .Cm tog tree
630 are as follows (N denotes optional prefixed count modifier):
631 .Bl -tag -width Ds
632 .It Cm Down-arrow, j, Ctrl-n
633 Move the selection cursor down N lines (default: 1).
634 .It Cm Up-arrow, k, Ctrl-p
635 Move the selection cursor up N lines (default: 1).
636 .It Cm Page-down, Space, Ctrl+f, f
637 Move the selection cursor down N pages (default: 1).
638 .It Cm Page-up, Ctrl+b, b
639 Move the selection cursor up N pages (default: 1).
640 .It Cm Ctrl+d, d
641 Move the selection cursor down N half pages (default: 1).
642 .It Cm Ctrl+u, u
643 Move the selection cursor up N half pages (default: 1).
644 .It Cm Home, =
645 Move the selection cursor to the first entry.
646 .It Cm End, *
647 Move the selection cursor to the last entry.
648 .It Cm g
649 Move the selection cursor to entry N (default: 1).
650 .It Cm G
651 Like
652 .Cm g
653 but defaults to the last entry.
654 .It Cm Enter
655 Enter the currently selected directory, or switch to the
656 .Cm blame
657 view for the currently selected file.
658 .It Cm L
659 Open a
660 .Cm log
661 view for the currently selected tree entry.
662 .It Cm R
663 Open a
664 .Cm ref
665 view listing all references in the repository.
666 This can then be used to open a new
667 .Cm tree
668 view for arbitrary branches and tags.
669 .It Cm Backspace
670 Move back to the Nth parent directory (default: 1).
671 .It Cm i
672 Show object IDs for all objects displayed in the
673 .Cm tree
674 view.
675 .It Cm /
676 Prompt for a search pattern and start searching for matching tree entries.
677 The search pattern is an extended regular expression which is matched
678 against the tree entry's name.
679 Regular expression syntax is documented in
680 .Xr re_format 7 .
681 .It Cm n
682 Find the Nth next tree entry which matches the current search pattern
683 (default: 1).
684 .It Cm N
685 Find the Nth previous tree entry which matches the current search pattern
686 (default: 1).
687 .El
688 .Pp
689 The options for
690 .Cm tog tree
691 are as follows:
692 .Bl -tag -width Ds
693 .It Fl c Ar commit
694 Start traversing history at the specified
695 .Ar commit .
696 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
697 which will be resolved to a commit ID.
698 An abbreviated hash argument will be expanded to a full SHA1 hash
699 automatically, provided the abbreviation is unique.
700 The keywords
701 .Qq :base
702 and
703 .Qq :head
704 resolve to the work tree's base commit and branch head, respectively.
705 The former is only valid if invoked in a work tree, while the latter will
706 resolve to the tip of the work tree's current branch if invoked in a
707 work tree, otherwise it will resolve to the repository's HEAD reference.
708 Keywords and references may be appended with
709 .Qq :+
710 or
711 .Qq :-
712 modifiers and an optional integer N to denote the
713 Nth descendant or antecedent by first parent traversal, respectively;
714 for example,
715 .Sy :head:-2
716 denotes the work tree branch head's 2nd generation ancestor, and
717 .Sy :base:+4
718 denotes the 4th generation descendant of the work tree's base commit.
719 Similarly,
720 .Sy foobar:+3
721 will denote the 3rd generation descendant of the commit resolved by the
722 .Qq foobar
723 reference.
725 .Qq :+
726 or
727 .Qq :-
728 modifier without a trailing integer has an implicit
729 .Qq 1
730 appended
731 .Po e.g.,
732 .Sy :base:+
733 is equivalent to
734 .Sy :base:+1
735 .Pc .
736 .It Fl r Ar repository-path
737 Use the repository at the specified path.
738 If not specified, assume the repository is located at or above the current
739 working directory.
740 If this directory is a
741 .Xr got 1
742 work tree, use the repository path associated with this work tree.
743 .El
744 .It Cm ref Op Fl r Ar repository-path
745 Display references in the repository.
746 .Pp
747 The key bindings for
748 .Cm tog ref
749 are as follows (N denotes optional prefixed count modifier):
750 .Bl -tag -width Ds
751 .It Cm Down-arrow, j, Ctrl-n
752 Move the selection cursor down N lines (default: 1).
753 .It Cm Up-arrow, k, Ctrl-p
754 Move the selection cursor up N lines (default: 1).
755 .It Cm Page-down, Space, Ctrl+f, f
756 Move the selection cursor down N pages (default: 1).
757 .It Cm Page-up, Ctrl+b, b
758 Move the selection cursor up N pages (default: 1).
759 .It Cm Ctrl+d, d
760 Move the selection cursor down N half pages (default: 1).
761 .It Cm Ctrl+u, u
762 Move the selection cursor up N half pages (default: 1).
763 .It Cm Home, =
764 Move the selection cursor to the first reference.
765 .It Cm End, *
766 Move the selection cursor to the last reference.
767 .It Cm g
768 Move the selection cursor to reference N (default: 1).
769 .It Cm G
770 Like
771 .Cm g
772 but defaults to the last reference.
773 .It Cm Enter
774 Open a
775 .Cm log
776 view which begins traversing history at the commit resolved via the
777 currently selected reference.
778 .It Cm T
779 Open a
780 .Cm tree
781 view showing the tree resolved via the currently selected reference.
782 .It Cm i
783 Show object IDs for all non-symbolic references displayed in the
784 .Cm ref
785 view.
786 .It Cm m
787 Show last modified date of each displayed reference.
788 .It Cm o
789 Toggle display order of references between sort by name and sort by timestamp.
790 .It Cm /
791 Prompt for a search pattern and start searching for matching references.
792 The search pattern is an extended regular expression which is matched
793 against absolute reference names.
794 Regular expression syntax is documented in
795 .Xr re_format 7 .
796 .It Cm n
797 Find the Nth next reference which matches the current search pattern
798 (default: 1).
799 .It Cm N
800 Find the Nth previous reference which matches the current search pattern
801 (default: 1).
802 .It Cm Ctrl+l
803 Reload the list of references displayed by the
804 .Cm ref
805 view.
806 .El
807 .Pp
808 The options for
809 .Cm tog ref
810 are as follows:
811 .Bl -tag -width Ds
812 .It Fl r Ar repository-path
813 Use the repository at the specified path.
814 If not specified, assume the repository is located at or above the current
815 working directory.
816 If this directory is a
817 .Xr got 1
818 work tree, use the repository path associated with this work tree.
819 .El
820 .El
821 .Sh ENVIRONMENT
822 .Bl -tag -width TOG_VIEW_SPLIT_MODE
823 .It Ev TOG_COLORS
824 .Nm
825 shows colorized output if this variable is set to a non-empty value.
826 The default color scheme can be modified by setting the environment
827 variables documented below.
828 The colors available in color schemes are
829 .Dq black ,
830 .Dq red ,
831 .Dq green ,
832 .Dq yellow ,
833 .Dq blue ,
834 .Dq magenta ,
835 .Dq cyan ,
836 and
837 .Dq default
838 which maps to the terminal's default foreground color.
839 .It Ev TOG_COLOR_AUTHOR
840 The color used to mark up author information.
841 If not set, the default value
842 .Dq cyan
843 is used.
844 .It Ev TOG_COLOR_COMMIT
845 The color used to mark up commit IDs.
846 If not set, the default value
847 .Dq green
848 is used.
849 .It Ev TOG_COLOR_DATE
850 The color used to mark up date information.
851 If not set, the default value
852 .Dq yellow
853 is used.
854 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
855 The color used to mark up chunk header lines in diffs.
856 If not set, the default value
857 .Dq yellow
858 is used.
859 .It Ev TOG_COLOR_DIFF_META
860 The color used to mark up meta data in diffs.
861 If not set, the default value
862 .Dq green
863 is used.
864 .It Ev TOG_COLOR_DIFF_MINUS
865 The color used to mark up removed lines in diffs.
866 If not set, the default value
867 .Dq magenta
868 is used.
869 .It Ev TOG_COLOR_DIFF_PLUS
870 The color used to mark up added lines in diffs.
871 If not set, the default value
872 .Dq cyan
873 is used.
874 .It Ev TOG_COLOR_REFS_BACKUP
875 The color used to mark up references in the
876 .Dq refs/got/backup/
877 namespace.
878 If not set, the default value
879 .Dq cyan
880 is used.
881 .It Ev TOG_COLOR_REFS_HEADS
882 The color used to mark up references in the
883 .Dq refs/heads/
884 namespace.
885 If not set, the default value
886 .Dq green
887 is used.
888 .It Ev TOG_COLOR_REFS_REMOTES
889 The color used to mark up references in the
890 .Dq refs/remotes/
891 namespace.
892 If not set, the default value
893 .Dq yellow
894 is used.
895 .It Ev TOG_COLOR_REFS_TAGS
896 The color used to mark up references in the
897 .Dq refs/tags/
898 namespace.
899 If not set, the default value
900 .Dq magenta
901 is used.
902 .It Ev TOG_COLOR_TREE_DIRECTORY
903 The color used to mark up directory tree entries.
904 If not set, the default value
905 .Dq cyan
906 is used.
907 .It Ev TOG_COLOR_TREE_EXECUTABLE
908 The color used to mark up executable file tree entries.
909 If not set, the default value
910 .Dq green
911 is used.
912 .It Ev TOG_COLOR_TREE_SUBMODULE
913 The color used to mark up submodule tree entries.
914 If not set, the default value
915 .Dq magenta
916 is used.
917 .It Ev TOG_COLOR_TREE_SYMLINK
918 The color used to mark up symbolic link tree entries.
919 If not set, the default value
920 .Dq magenta
921 is used.
922 .It Ev TOG_DIFF_ALGORITHM
923 Determines the default diff algorithm used by
924 .Nm .
925 Supported diff algorithms are Myers (quick and dirty) and
926 Patience (slow and tidy).
927 Valid values for
928 .Ev TOG_DIFF_ALGORITHM
929 are
930 .Dq patience
931 and
932 .Dq myers .
933 If unset, the Myers diff algorithm will be used by default.
934 .It Ev TOG_VIEW_SPLIT_MODE
935 Determines the default layout of split-screen views.
936 If set to
937 .Dq h
938 or
939 .Dq H ,
940 .Nm
941 will use horizontal split by default.
942 Otherwise, vertical split will be used.
943 The
944 .Cm S
945 key can be used to switch between vertical and horizontal split layout
946 at run-time.
947 .El
948 .Sh EXIT STATUS
949 .Ex -std tog
950 .Sh SEE ALSO
951 .Xr got 1 ,
952 .Xr git-repository 5 ,
953 .Xr re_format 7
954 .Sh AUTHORS
955 .An Christian Weisgerber Aq Mt naddy@openbsd.org
956 .An Josh Rickmar Aq Mt jrick@zettaport.com
957 .An Joshua Stein Aq Mt jcs@openbsd.org
958 .An Mark Jamsek Aq Mt mark@jamsek.dev
959 .An Martin Pieuchot Aq Mt mpi@openbsd.org
960 .An Omar Polo Aq Mt op@openbsd.org
961 .An Stefan Sperling Aq Mt stsp@openbsd.org
962 .An Klemens Nanni Aq Mt kn@openbsd.org