Blob


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