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