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