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 An arbitrary number of views may be opened simultaneously by
36 navigating the repository with
37 .Nm .
38 Sometimes, if one view is opened from another view, the child view
39 is linked to its parent view and both views will keep their data
40 display in sync.
41 The supported views are:
42 .Bl -tag -width Ds
43 .It Cm log view
44 Displays commits in the repository's history.
45 This view is displayed initially if no
46 .Ar command
47 is specified.
48 .It Cm diff view
49 Displays changes made in a particular commit.
50 .It Cm blame view
51 Displays the line-by-line history of a file.
52 .It Cm tree view
53 Displays the tree corresponding to a particular commit.
54 .El
55 .Pp
56 .Nm
57 provides global and command-specific key bindings and options.
58 The global key bindings are:
59 .Bl -tag -width Ds
60 .It Cm Q
61 Quit
62 .Nm .
63 .It Cm q
64 Quit the view which is in focus.
65 .It Cm Tab
66 Switch focus to the next view.
67 Cycles through all open views.
68 .It Cm ~
69 Switch focus to the previous view.
70 Cycles through all open views.
71 .El
72 .Pp
73 Global options must precede the command name, and are as follows:
74 .Bl -tag -width tenletters
75 .It Fl h
76 Display usage information.
77 .El
78 .Pp
79 The commands for
80 .Nm
81 are as follows:
82 .Bl -tag -width blame
83 .It Cm log [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ path ]
84 Display history of a repository.
85 If a
86 .Ar path
87 is specified, show only commits which modified this path.
88 .Pp
89 This command is also executed if no explicit command is specified.
90 .Pp
91 The key bindings for
92 .Cm tog log
93 are as follows:
94 .Bl -tag -width Ds
95 .It Cm Down-arrow, j, ], Page-down
96 Move the selection cursor down.
97 .It Cm Up-arrow, k, [, Page-up
98 Move the selection cursor up.
99 .It Cm Enter
100 Switch to the
101 .Cm diff
102 view showing file changes made in the currently selected commit.
103 The diff view is linked to the log view so either view will be
104 updated when the other switches to a different commit.
105 .It Cm t
106 Switch to the
107 .Cm tree
108 view showing the tree for the currently selected commit.
109 .It Cm Backspace
110 Show log entries for the parent directory of the currently selected path.
111 .El
112 .Pp
113 The options for
114 .Cm tog log
115 are as follows:
116 .Bl -tag -width Ds
117 .It Fl c Ar commit
118 Start traversing history at the specified
119 .Ar commit .
120 The expected argument is the name of a branch or a SHA1 hash which corresponds
121 to a commit object.
122 .It Fl r Ar repository-path
123 Use the repository at the specified path.
124 If not specified, assume the repository is located at or above the current
125 working directory.
126 .El
127 .It Cm diff [ Ar repository-path ] Ar object1 Ar object2
128 Display the differences between two objects in the repository.
129 Each
130 .Ar object
131 argument is a SHA1 hash which corresponds to the object.
132 Both objects must be of the same type (blobs, trees, or commits).
133 If the
134 .Ar repository path
135 is omitted, use the current working directory.
136 .Pp
137 The key bindings for
138 .Cm tog diff
139 are as follows:
140 .Bl -tag -width Ds
141 .It Cm Down-arrow, j, Page-down, Space
142 Scroll down.
143 .It Cm Up-arrow, k, Page-up
144 Scroll up.
145 .It [
146 Switch to the previous commit in parent
147 .Cm log view .
148 .It ]
149 Switch to the next commit in parent
150 .Cm log view .
151 .El
152 .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
153 Display line-by-line history of a file at the specified path.
154 .Pp
155 The key bindings for
156 .Cm tog blame
157 are as follows:
158 .Bl -tag -width Ds
159 .It Cm Down-arrow, j, Page-down, Space
160 Move the selection cursor down.
161 .It Cm Up-arrow, k, Page-up
162 Move the selection cursor up.
163 .It Cm Enter
164 Switch to the
165 .Cm diff
166 view for the currently selected line's commit.
167 .It Cm b
168 Show the
169 .Cm blame
170 view for the version of the file in the currently selected line's commit.
171 .It Cm p
172 Show the
173 .Cm blame
174 view for the version of the file in the currently selected line's commit's
175 parent commit.
176 .It Cm B
177 Switch the
178 .Cm blame
179 view back to the previously blamed commit.
180 .El
181 .Pp
182 The options for
183 .Cm tog blame
184 are as follows:
185 .Bl -tag -width Ds
186 .It Fl c Ar commit
187 Start traversing history at the specified
188 .Ar commit .
189 The expected argument is the name of a branch or a SHA1 hash which corresponds
190 to a commit object.
191 .It Fl r Ar repository-path
192 Use the repository at the specified path.
193 If not specified, assume the repository is located at or above the current
194 working directory.
195 .El
196 .It Cm tree [ Fl c Ar commit ] [ Ar repository-path ]
197 Display the repository tree.
198 If the
199 .Ar repository path
200 is omitted, assume the repository is located in the current working directory.
201 .Pp
202 The key bindings for
203 .Cm tog tree
204 are as follows:
205 .Bl -tag -width Ds
206 .It Cm Down-arrow, j, Page-down
207 Move the selection cursor down.
208 .It Cm Up-arrow, k, Page-up
209 Move the selection cursor up.
210 .It Cm Enter
211 Enter the currently selected directory, or switch to the
212 .Cm blame
213 view for the currently selected file.
214 .It Cm l
215 Switch to the
216 .Cm log
217 view for the currently selected tree entry.
218 .It Cm Backspace
219 Move back to the parent directory.
220 .It Cm i
221 Show the object IDs for all objects displayed in the
222 .Cm tree
223 view.
224 .El
225 .Pp
226 The options for
227 .Cm tog tree
228 are as follows:
229 .Bl -tag -width Ds
230 .It Fl c Ar commit
231 Start traversing history at the specified
232 .Ar commit .
233 The expected argument is the name of a branch or a SHA1 hash which corresponds
234 to a commit object.
235 .El
236 .El
237 .Sh EXIT STATUS
238 .Ex -std tog
239 .Sh SEE ALSO
240 .Xr git-repository 5
241 .Sh AUTHORS
242 .An Stefan Sperling Aq Mt stsp@openbsd.org