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