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