Blob


1 .\"
2 .\" Copyright (c) 2018 Stefan Sperling
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd $Mdocdate$
17 .Dt TOG 1
18 .Os
19 .Sh NAME
20 .Nm tog
21 .Nd git repository browser
22 .Sh SYNOPSIS
23 .Nm
24 .Ar command
25 .Op Fl h
26 .Op Ar arg ...
27 .Sh DESCRIPTION
28 .Nm
29 is an interactive read-only browser for git repositories.
30 This repository format is described in
31 .Xr git-repository 5 .
32 .Pp
33 .Nm
34 supports several types of views which display repository data:
35 .Bl -tag -width Ds
36 .It Cm log view
37 Displays commits in the repository's history.
38 This view is displayed initially if no
39 .Ar command
40 is specified.
41 .It Cm diff view
42 Displays changes made in a particular commit.
43 .It Cm blame view
44 Displays the line-by-line history of a file.
45 .It Cm tree view
46 Displays the tree corresponding to a particular commit.
47 .El
48 .Pp
49 .Nm
50 provides global and command-specific key bindings and options.
51 The global key bindings are:
52 .Bl -tag -width Ds
53 .It Cm Q
54 Quit
55 .Nm .
56 .It Cm q
57 Quit the view which is in focus.
58 .It Cm Tab
59 Switch focus between views.
60 .It Cm f
61 Toggle fullscreen mode for a split-screen view.
62 .El
63 .Pp
64 Global options must precede the command name, and are as follows:
65 .Bl -tag -width tenletters
66 .It Fl h
67 Display usage information.
68 .El
69 .Pp
70 The commands for
71 .Nm
72 are as follows:
73 .Bl -tag -width blame
74 .It Cm log [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ path ]
75 Display history of a repository.
76 If a
77 .Ar path
78 is specified, show only commits which modified this path.
79 .Pp
80 This command is also executed if no explicit command is specified.
81 .Pp
82 The key bindings for
83 .Cm tog log
84 are as follows:
85 .Bl -tag -width Ds
86 .It Cm Down-arrow, j, Page-down
87 Move the selection cursor down.
88 .It Cm Up-arrow, k, Page-up
89 Move the selection cursor up.
90 .It Cm Enter
91 Open a
92 .Cm diff
93 view showing file changes made in the currently selected commit.
94 .It Cm t
95 Open a
96 .Cm tree
97 view showing the tree for the currently selected commit.
98 .It Cm Backspace
99 Show log entries for the parent directory of the currently selected path.
100 .El
101 .Pp
102 The options for
103 .Cm tog log
104 are as follows:
105 .Bl -tag -width Ds
106 .It Fl c Ar commit
107 Start traversing history at the specified
108 .Ar commit .
109 The expected argument is the name of a branch or a SHA1 hash which corresponds
110 to a commit object.
111 .It Fl r Ar repository-path
112 Use the repository at the specified path.
113 If not specified, assume the repository is located at or above the current
114 working directory.
115 .El
116 .It Cm diff [ Ar repository-path ] Ar object1 Ar object2
117 Display the differences between two objects in the repository.
118 Each
119 .Ar object
120 argument is a SHA1 hash which corresponds to the object.
121 Both objects must be of the same type (blobs, trees, or commits).
122 If the
123 .Ar repository path
124 is omitted, use the current working directory.
125 .Pp
126 The key bindings for
127 .Cm tog diff
128 are as follows:
129 .Bl -tag -width Ds
130 .It Cm Down-arrow, j, Page-down, Space
131 Scroll down.
132 .It Cm Up-arrow, k, Page-up
133 Scroll up.
134 .It Cm [
135 Reduce the amount of diff context lines.
136 .It Cm ]
137 Increase the amount of diff context lines.
138 .El
139 .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
140 Display line-by-line history of a file at the specified path.
141 .Pp
142 The key bindings for
143 .Cm tog blame
144 are as follows:
145 .Bl -tag -width Ds
146 .It Cm Down-arrow, j, Page-down, Space
147 Move the selection cursor down.
148 .It Cm Up-arrow, k, Page-up
149 Move the selection cursor up.
150 .It Cm Enter
151 Open a
152 .Cm diff
153 view for the currently selected line's commit.
154 .It Cm b
155 Reload the
156 .Cm blame
157 view with the version of the file as found in the currently
158 selected line's commit.
159 .It Cm p
160 Reload the
161 .Cm blame
162 view with the version of the file as found in the parent commit of the
163 currently selected line's commit.
164 .It Cm B
165 Reload the
166 .Cm blame
167 view with the previously blamed commit.
168 .El
169 .Pp
170 The options for
171 .Cm tog blame
172 are as follows:
173 .Bl -tag -width Ds
174 .It Fl c Ar commit
175 Start traversing history at the specified
176 .Ar commit .
177 The expected argument is the name of a branch or a SHA1 hash which corresponds
178 to a commit object.
179 .It Fl r Ar repository-path
180 Use the repository at the specified path.
181 If not specified, assume the repository is located at or above the current
182 working directory.
183 .El
184 .It Cm tree [ Fl c Ar commit ] [ Ar repository-path ]
185 Display the repository tree.
186 If the
187 .Ar repository path
188 is omitted, assume the repository is located in the current working directory.
189 .Pp
190 The key bindings for
191 .Cm tog tree
192 are as follows:
193 .Bl -tag -width Ds
194 .It Cm Down-arrow, j, Page-down
195 Move the selection cursor down.
196 .It Cm Up-arrow, k, Page-up
197 Move the selection cursor up.
198 .It Cm Enter
199 Enter the currently selected directory, or switch to the
200 .Cm blame
201 view for the currently selected file.
202 .It Cm l
203 Open a
204 .Cm log
205 view for the currently selected tree entry.
206 .It Cm Backspace
207 Move back to the parent directory.
208 .It Cm i
209 Show object IDs for all objects displayed in the
210 .Cm tree
211 view.
212 .El
213 .Pp
214 The options for
215 .Cm tog tree
216 are as follows:
217 .Bl -tag -width Ds
218 .It Fl c Ar commit
219 Start traversing history at the specified
220 .Ar commit .
221 The expected argument is the name of a branch or a SHA1 hash which corresponds
222 to a commit object.
223 .El
224 .El
225 .Sh EXIT STATUS
226 .Ex -std tog
227 .Sh SEE ALSO
228 .Xr git-repository 5
229 .Sh AUTHORS
230 .An Stefan Sperling Aq Mt stsp@openbsd.org