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, >, Full stop
87 Move the selection cursor down.
88 .It Cm Up-arrow, k, Page-up, <, Comma
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 .It Cm <, Comma
139 If the diff view was opened via the log view, move to the previous (younger)
140 commit.
141 .It Cm >, Full stop
142 If the diff view was opened via the log view, move to the next (older) commit.
143 .El
144 .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
145 Display line-by-line history of a file at the specified path.
146 .Pp
147 The key bindings for
148 .Cm tog blame
149 are as follows:
150 .Bl -tag -width Ds
151 .It Cm Down-arrow, j, Page-down, Space
152 Move the selection cursor down.
153 .It Cm Up-arrow, k, Page-up
154 Move the selection cursor up.
155 .It Cm Enter
156 Open a
157 .Cm diff
158 view for the currently selected line's commit.
159 .It Cm b
160 Reload the
161 .Cm blame
162 view with the version of the file as found in the currently
163 selected line's commit.
164 .It Cm p
165 Reload the
166 .Cm blame
167 view with the version of the file as found in the parent commit of the
168 currently selected line's commit.
169 .It Cm B
170 Reload the
171 .Cm blame
172 view with the previously blamed commit.
173 .El
174 .Pp
175 The options for
176 .Cm tog blame
177 are as follows:
178 .Bl -tag -width Ds
179 .It Fl c Ar commit
180 Start traversing history at the specified
181 .Ar commit .
182 The expected argument is the name of a branch or a SHA1 hash which corresponds
183 to a commit object.
184 .It Fl r Ar repository-path
185 Use the repository at the specified path.
186 If not specified, assume the repository is located at or above the current
187 working directory.
188 .El
189 .It Cm tree [ Fl c Ar commit ] [ Ar repository-path ]
190 Display the repository tree.
191 If the
192 .Ar repository path
193 is omitted, assume the repository is located in the current working directory.
194 .Pp
195 The key bindings for
196 .Cm tog tree
197 are as follows:
198 .Bl -tag -width Ds
199 .It Cm Down-arrow, j, Page-down
200 Move the selection cursor down.
201 .It Cm Up-arrow, k, Page-up
202 Move the selection cursor up.
203 .It Cm Enter
204 Enter the currently selected directory, or switch to the
205 .Cm blame
206 view for the currently selected file.
207 .It Cm l
208 Open a
209 .Cm log
210 view for the currently selected tree entry.
211 .It Cm Backspace
212 Move back to the parent directory.
213 .It Cm i
214 Show object IDs for all objects displayed in the
215 .Cm tree
216 view.
217 .El
218 .Pp
219 The options for
220 .Cm tog tree
221 are as follows:
222 .Bl -tag -width Ds
223 .It Fl c Ar commit
224 Start traversing history at the specified
225 .Ar commit .
226 The expected argument is the name of a branch or a SHA1 hash which corresponds
227 to a commit object.
228 .El
229 .El
230 .Sh EXIT STATUS
231 .Ex -std tog
232 .Sh SEE ALSO
233 .Xr git-repository 5
234 .Sh AUTHORS
235 .An Stefan Sperling Aq Mt stsp@openbsd.org