Commit | Line | Data |
---|---|---|
3ad8214b JF |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r |
2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r | |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r | |
4 | <head>\r | |
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r | |
6 | <meta name="generator" content="AsciiDoc 7.0.2" />\r | |
7 | <style type="text/css">\r | |
8 | /* Debug borders */\r | |
9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r | |
10 | /*\r | |
11 | border: 1px solid red;\r | |
12 | */\r | |
13 | }\r | |
14 | \r | |
15 | body {\r | |
16 | margin: 1em 5% 1em 5%;\r | |
17 | }\r | |
18 | \r | |
19 | a { color: blue; }\r | |
20 | a:visited { color: fuchsia; }\r | |
21 | \r | |
22 | em {\r | |
23 | font-style: italic;\r | |
24 | }\r | |
25 | \r | |
26 | strong {\r | |
27 | font-weight: bold;\r | |
28 | }\r | |
29 | \r | |
30 | tt {\r | |
31 | color: navy;\r | |
32 | }\r | |
33 | \r | |
34 | h1, h2, h3, h4, h5, h6 {\r | |
35 | color: #527bbd;\r | |
36 | font-family: sans-serif;\r | |
37 | margin-top: 1.2em;\r | |
38 | margin-bottom: 0.5em;\r | |
39 | line-height: 1.3;\r | |
40 | }\r | |
41 | \r | |
42 | h1 {\r | |
43 | border-bottom: 2px solid silver;\r | |
44 | }\r | |
45 | h2 {\r | |
46 | border-bottom: 2px solid silver;\r | |
47 | padding-top: 0.5em;\r | |
48 | }\r | |
49 | \r | |
50 | div.sectionbody {\r | |
51 | font-family: serif;\r | |
52 | margin-left: 0;\r | |
53 | }\r | |
54 | \r | |
55 | hr {\r | |
56 | border: 1px solid silver;\r | |
57 | }\r | |
58 | \r | |
59 | p {\r | |
60 | margin-top: 0.5em;\r | |
61 | margin-bottom: 0.5em;\r | |
62 | }\r | |
63 | \r | |
64 | pre {\r | |
65 | padding: 0;\r | |
66 | margin: 0;\r | |
67 | }\r | |
68 | \r | |
69 | span#author {\r | |
70 | color: #527bbd;\r | |
71 | font-family: sans-serif;\r | |
72 | font-weight: bold;\r | |
73 | font-size: 1.2em;\r | |
74 | }\r | |
75 | span#email {\r | |
76 | }\r | |
77 | span#revision {\r | |
78 | font-family: sans-serif;\r | |
79 | }\r | |
80 | \r | |
81 | div#footer {\r | |
82 | font-family: sans-serif;\r | |
83 | font-size: small;\r | |
84 | border-top: 2px solid silver;\r | |
85 | padding-top: 0.5em;\r | |
86 | margin-top: 4.0em;\r | |
87 | }\r | |
88 | div#footer-text {\r | |
89 | float: left;\r | |
90 | padding-bottom: 0.5em;\r | |
91 | }\r | |
92 | div#footer-badges {\r | |
93 | float: right;\r | |
94 | padding-bottom: 0.5em;\r | |
95 | }\r | |
96 | \r | |
97 | div#preamble,\r | |
98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock,\r | |
99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r | |
100 | div.admonitionblock {\r | |
101 | margin-right: 10%;\r | |
102 | margin-top: 1.5em;\r | |
103 | margin-bottom: 1.5em;\r | |
104 | }\r | |
105 | div.admonitionblock {\r | |
106 | margin-top: 2.5em;\r | |
107 | margin-bottom: 2.5em;\r | |
108 | }\r | |
109 | \r | |
110 | div.content { /* Block element content. */\r | |
111 | padding: 0;\r | |
112 | }\r | |
113 | \r | |
114 | /* Block element titles. */\r | |
115 | div.title, caption.title {\r | |
116 | font-family: sans-serif;\r | |
117 | font-weight: bold;\r | |
118 | text-align: left;\r | |
119 | margin-top: 1.0em;\r | |
120 | margin-bottom: 0.5em;\r | |
121 | }\r | |
122 | div.title + * {\r | |
123 | margin-top: 0;\r | |
124 | }\r | |
125 | \r | |
126 | td div.title:first-child {\r | |
127 | margin-top: 0.0em;\r | |
128 | }\r | |
129 | div.content div.title:first-child {\r | |
130 | margin-top: 0.0em;\r | |
131 | }\r | |
132 | div.content + div.title {\r | |
133 | margin-top: 0.0em;\r | |
134 | }\r | |
135 | \r | |
136 | div.sidebarblock > div.content {\r | |
137 | background: #ffffee;\r | |
138 | border: 1px solid silver;\r | |
139 | padding: 0.5em;\r | |
140 | }\r | |
141 | \r | |
142 | div.listingblock > div.content {\r | |
143 | border: 1px solid silver;\r | |
144 | background: #f4f4f4;\r | |
145 | padding: 0.5em;\r | |
146 | }\r | |
147 | \r | |
148 | div.quoteblock > div.content {\r | |
149 | padding-left: 2.0em;\r | |
150 | }\r | |
151 | div.quoteblock .attribution {\r | |
152 | text-align: right;\r | |
153 | }\r | |
154 | \r | |
155 | div.admonitionblock .icon {\r | |
156 | vertical-align: top;\r | |
157 | font-size: 1.1em;\r | |
158 | font-weight: bold;\r | |
159 | text-decoration: underline;\r | |
160 | color: #527bbd;\r | |
161 | padding-right: 0.5em;\r | |
162 | }\r | |
163 | div.admonitionblock td.content {\r | |
164 | padding-left: 0.5em;\r | |
165 | border-left: 2px solid silver;\r | |
166 | }\r | |
167 | \r | |
168 | div.exampleblock > div.content {\r | |
169 | border-left: 2px solid silver;\r | |
170 | padding: 0.5em;\r | |
171 | }\r | |
172 | \r | |
173 | div.verseblock div.content {\r | |
174 | white-space: pre;\r | |
175 | }\r | |
176 | \r | |
177 | div.imageblock div.content { padding-left: 0; }\r | |
178 | div.imageblock img { border: 1px solid silver; }\r | |
179 | span.image img { border-style: none; }\r | |
180 | \r | |
181 | dl {\r | |
182 | margin-top: 0.8em;\r | |
183 | margin-bottom: 0.8em;\r | |
184 | }\r | |
185 | dt {\r | |
186 | margin-top: 0.5em;\r | |
187 | margin-bottom: 0;\r | |
188 | font-style: italic;\r | |
189 | }\r | |
190 | dd > *:first-child {\r | |
191 | margin-top: 0;\r | |
192 | }\r | |
193 | \r | |
194 | ul, ol {\r | |
195 | list-style-position: outside;\r | |
196 | }\r | |
197 | ol.olist2 {\r | |
198 | list-style-type: lower-alpha;\r | |
199 | }\r | |
200 | \r | |
201 | div.tableblock > table {\r | |
202 | border-color: #527bbd;\r | |
203 | border-width: 3px;\r | |
204 | }\r | |
205 | thead {\r | |
206 | font-family: sans-serif;\r | |
207 | font-weight: bold;\r | |
208 | }\r | |
209 | tfoot {\r | |
210 | font-weight: bold;\r | |
211 | }\r | |
212 | \r | |
213 | div.hlist {\r | |
214 | margin-top: 0.8em;\r | |
215 | margin-bottom: 0.8em;\r | |
216 | }\r | |
217 | td.hlist1 {\r | |
218 | vertical-align: top;\r | |
219 | font-style: italic;\r | |
220 | padding-right: 0.8em;\r | |
221 | }\r | |
222 | td.hlist2 {\r | |
223 | vertical-align: top;\r | |
224 | }\r | |
225 | \r | |
226 | @media print {\r | |
227 | div#footer-badges { display: none; }\r | |
228 | }\r | |
229 | /* Workarounds for IE6's broken and incomplete CSS2. */\r | |
230 | \r | |
231 | div.sidebar-content {\r | |
232 | background: #ffffee;\r | |
233 | border: 1px solid silver;\r | |
234 | padding: 0.5em;\r | |
235 | }\r | |
236 | div.sidebar-title, div.image-title {\r | |
237 | font-family: sans-serif;\r | |
238 | font-weight: bold;\r | |
239 | margin-top: 0.0em;\r | |
240 | margin-bottom: 0.5em;\r | |
241 | }\r | |
242 | \r | |
243 | div.listingblock div.content {\r | |
244 | border: 1px solid silver;\r | |
245 | background: #f4f4f4;\r | |
246 | padding: 0.5em;\r | |
247 | }\r | |
248 | \r | |
249 | div.quoteblock-content {\r | |
250 | padding-left: 2.0em;\r | |
251 | }\r | |
252 | \r | |
253 | div.exampleblock-content {\r | |
254 | border-left: 2px solid silver;\r | |
255 | padding-left: 0.5em;\r | |
256 | }\r | |
257 | </style>\r | |
258 | <title>The tig Manual</title>\r | |
259 | </head>\r | |
260 | <body>\r | |
261 | <div id="header">\r | |
262 | <h1>The tig Manual</h1>\r | |
263 | <span id="author">Jonas Fonseca</span><br />\r | |
264 | <span id="email"><tt><<a href="mailto:fonseca@diku.dk">fonseca@diku.dk</a>></tt></span><br />\r | |
265 | </div>\r | |
266 | <div id="preamble">\r | |
267 | <div class="sectionbody">\r | |
268 | <p>This is the manual for tig, the ncurses-based text-mode interface for git.\r | |
269 | Tig allows you to browse changes in a git repository and can additionally act\r | |
270 | as a pager for output of various git commands. When used as a pager, it will\r | |
271 | display input from stdin and colorize it.</p>\r | |
272 | <p>When browsing repositories, tig uses the underlying git commands to present\r | |
273 | the user with various views, such as summarized commit log and showing the\r | |
274 | commit with the log message, diffstat, and the diff.</p>\r | |
b484cbc8 JF |
275 | <p><strong>Table of Contents</strong></p>\r |
276 | <ol>\r | |
277 | <li>\r | |
278 | <p>\r | |
279 | <a href="#calling-conventions">Calling Conventions</a>\r | |
280 | </p>\r | |
281 | <ul>\r | |
282 | <li>\r | |
283 | <p>\r | |
284 | <a href="#pager-mode">Pager Mode</a>\r | |
285 | </p>\r | |
286 | </li>\r | |
287 | <li>\r | |
288 | <p>\r | |
289 | <a href="#cmd-options">Git Command Options</a>\r | |
290 | </p>\r | |
291 | </li>\r | |
292 | </ul>\r | |
293 | </li>\r | |
294 | <li>\r | |
295 | <p>\r | |
296 | <a href="#env-variables">Environment Variables</a>\r | |
297 | </p>\r | |
298 | <ul>\r | |
299 | <li>\r | |
300 | <p>\r | |
301 | <a href="#repo-refs">Repository References</a>\r | |
302 | </p>\r | |
303 | </li>\r | |
304 | <li>\r | |
305 | <p>\r | |
306 | <a href="#history-commands">History Commands</a>\r | |
307 | </p>\r | |
308 | </li>\r | |
309 | </ul>\r | |
310 | </li>\r | |
311 | <li>\r | |
312 | <p>\r | |
313 | <a href="#viewer">The Viewer</a>\r | |
314 | </p>\r | |
315 | <ul>\r | |
316 | <li>\r | |
317 | <p>\r | |
318 | <a href="#commit-id">Current Head and Commit ID</a>\r | |
319 | </p>\r | |
320 | </li>\r | |
321 | <li>\r | |
322 | <p>\r | |
323 | <a href="#views">Views</a>\r | |
324 | </p>\r | |
325 | </li>\r | |
326 | <li>\r | |
327 | <p>\r | |
328 | <a href="#title-window">Title Windows</a>\r | |
329 | </p>\r | |
330 | </li>\r | |
c3a4b3e0 JF |
331 | </ul>\r |
332 | </li>\r | |
333 | <li>\r | |
334 | <p>\r | |
335 | <a href="#keys">Default Keybindings</a>\r | |
336 | </p>\r | |
337 | <ul>\r | |
b484cbc8 JF |
338 | <li>\r |
339 | <p>\r | |
340 | <a href="#view-switching">View Switching</a>\r | |
341 | </p>\r | |
342 | </li>\r | |
343 | <li>\r | |
344 | <p>\r | |
345 | <a href="#view-manipulation">View Manipulation</a>\r | |
346 | </p>\r | |
347 | </li>\r | |
348 | <li>\r | |
349 | <p>\r | |
350 | <a href="#cursor-nav">Cursor Navigation</a>\r | |
351 | </p>\r | |
352 | </li>\r | |
353 | <li>\r | |
354 | <p>\r | |
355 | <a href="#view-scrolling">Scrolling</a>\r | |
356 | </p>\r | |
357 | </li>\r | |
358 | </ul>\r | |
359 | </li>\r | |
360 | <li>\r | |
361 | <p>\r | |
362 | <a href="#refspec">Revision Specification</a>\r | |
363 | </p>\r | |
364 | <ul>\r | |
365 | <li>\r | |
366 | <p>\r | |
367 | <a href="#path-limiting">Limit by Path Name</a>\r | |
368 | </p>\r | |
369 | </li>\r | |
370 | <li>\r | |
371 | <p>\r | |
372 | <a href="#date-number-limiting">Limit by Date or Number</a>\r | |
373 | </p>\r | |
374 | </li>\r | |
375 | <li>\r | |
376 | <p>\r | |
377 | <a href="#commit-range-limiting">Limiting by Commit Ranges</a>\r | |
378 | </p>\r | |
379 | </li>\r | |
380 | <li>\r | |
381 | <p>\r | |
382 | <a href="#reachability-limiting">Limiting by Reachability</a>\r | |
383 | </p>\r | |
384 | </li>\r | |
385 | <li>\r | |
386 | <p>\r | |
387 | <a href="#refspec-combi">Combining Revisions Specification</a>\r | |
388 | </p>\r | |
389 | </li>\r | |
390 | <li>\r | |
391 | <p>\r | |
392 | <a href="#refspec-all">Examining All Repository References</a>\r | |
393 | </p>\r | |
394 | </li>\r | |
395 | </ul>\r | |
396 | </li>\r | |
397 | <li>\r | |
398 | <p>\r | |
399 | <a href="#copy-right">Copyright</a>\r | |
400 | </p>\r | |
401 | </li>\r | |
402 | <li>\r | |
403 | <p>\r | |
404 | <a href="#references">References and Related Tools</a>\r | |
405 | </p>\r | |
406 | </li>\r | |
407 | </ol>\r | |
3ad8214b JF |
408 | </div>\r |
409 | </div>\r | |
b484cbc8 | 410 | <h2><a id="calling-conventions"></a>1. Calling Conventions</h2>\r |
3ad8214b | 411 | <div class="sectionbody">\r |
b484cbc8 | 412 | <h3><a id="pager-mode"></a>1.1. Pager Mode</h3>\r |
3ad8214b JF |
413 | <p>If stdin is a pipe, any log or diff options will be ignored and the pager view\r |
414 | will be opened loading data from stdin. The pager mode can be used for\r | |
415 | colorizing output from various git commands.</p>\r | |
416 | <p>Example on how to colorize the output of git-show(1):</p>\r | |
b484cbc8 | 417 | <div class="listingblock">\r |
3ad8214b JF |
418 | <div class="content">\r |
419 | <pre><tt>$ git show | tig</tt></pre>\r | |
420 | </div></div>\r | |
b484cbc8 | 421 | <h3><a id="cmd-options"></a>1.2. Git Command Options</h3>\r |
3ad8214b JF |
422 | <p>All git command options specified on the command line will be passed to the\r |
423 | given command and all will be shell quoted before they are passed to the\r | |
424 | shell.</p>\r | |
425 | <div class="admonitionblock">\r | |
426 | <table><tr>\r | |
427 | <td class="icon">\r | |
428 | <div class="title">Note</div>\r | |
429 | </td>\r | |
430 | <td class="content">If you specify options for the main view, you should not use the\r | |
431 | <tt>—pretty</tt> option as this option will be set automatically to the format\r | |
432 | expected by the main view.</td>\r | |
433 | </tr></table>\r | |
434 | </div>\r | |
435 | <p>Example on how to open the log view and show both author and committer\r | |
436 | information:</p>\r | |
b484cbc8 | 437 | <div class="listingblock">\r |
3ad8214b JF |
438 | <div class="content">\r |
439 | <pre><tt>$ tig log --pretty=fuller</tt></pre>\r | |
440 | </div></div>\r | |
441 | <p>See the <a href="#refspec">"Specifying revisions"</a> section below for an introduction\r | |
442 | to revision options supported by the git commands. For details on specific git\r | |
443 | command options, refer to the man page of the command in question.</p>\r | |
444 | </div>\r | |
b484cbc8 | 445 | <h2><a id="env-variables"></a>2. Environment Variables</h2>\r |
3ad8214b JF |
446 | <div class="sectionbody">\r |
447 | <p>Several options related to the interface with git can be configured via\r | |
448 | environment options.</p>\r | |
b484cbc8 | 449 | <h3><a id="repo-refs"></a>2.1. Repository References</h3>\r |
3ad8214b JF |
450 | <p>Commits that are referenced by tags and branch heads will be marked by the\r |
451 | reference name surrounded by <em>[</em> and <em>]</em>:</p>\r | |
b484cbc8 | 452 | <div class="listingblock">\r |
3ad8214b JF |
453 | <div class="content">\r |
454 | <pre><tt>2006-03-26 19:42 Petr Baudis | [cogito-0.17.1] Cogito 0.17.1</tt></pre>\r | |
455 | </div></div>\r | |
456 | <p>If you want to filter out certain directories under <tt>.git/refs/</tt>, say <tt>tmp</tt>\r | |
457 | you can do it by setting the following variable:</p>\r | |
b484cbc8 | 458 | <div class="listingblock">\r |
3ad8214b JF |
459 | <div class="content">\r |
460 | <pre><tt>$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig</tt></pre>\r | |
461 | </div></div>\r | |
462 | <p>Or set the variable permanently in your environment.</p>\r | |
463 | <dl>\r | |
464 | <dt>\r | |
465 | TIG_LS_REMOTE\r | |
466 | </dt>\r | |
467 | <dd>\r | |
468 | <p>\r | |
469 | Set command for retrieving all repository references. The command\r | |
470 | should output data in the same format as git-ls-remote(1).\r | |
471 | </p>\r | |
472 | </dd>\r | |
473 | </dl>\r | |
b484cbc8 | 474 | <h3><a id="history-commands"></a>2.2. History Commands</h3>\r |
3ad8214b JF |
475 | <p>It is possible to alter which commands are used for the different views. If\r |
476 | for example you prefer commits in the main view to be sorted by date and only\r | |
477 | show 500 commits, use:</p>\r | |
b484cbc8 | 478 | <div class="listingblock">\r |
3ad8214b JF |
479 | <div class="content">\r |
480 | <pre><tt>$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig</tt></pre>\r | |
481 | </div></div>\r | |
482 | <p>Or set the variable permanently in your environment.</p>\r | |
483 | <p>Notice, how <tt>%s</tt> is used to specify the commit reference. There can be a\r | |
484 | maximum of 5 <tt>%s</tt> ref specifications.</p>\r | |
485 | <dl>\r | |
486 | <dt>\r | |
487 | TIG_DIFF_CMD\r | |
488 | </dt>\r | |
489 | <dd>\r | |
490 | <p>\r | |
491 | The command used for the diff view. By default, git show is used\r | |
492 | as a backend.\r | |
493 | </p>\r | |
494 | </dd>\r | |
495 | <dt>\r | |
496 | TIG_LOG_CMD\r | |
497 | </dt>\r | |
498 | <dd>\r | |
499 | <p>\r | |
500 | The command used for the log view. If you prefer to have both\r | |
501 | author and committer shown in the log view be sure to pass\r | |
502 | <tt>—pretty=fuller</tt> to git log.\r | |
503 | </p>\r | |
504 | </dd>\r | |
505 | <dt>\r | |
506 | TIG_MAIN_CMD\r | |
507 | </dt>\r | |
508 | <dd>\r | |
509 | <p>\r | |
510 | The command used for the main view. Note, you must always specify\r | |
511 | the option: <tt>—pretty=raw</tt> since the main view parser expects to\r | |
512 | read that format.\r | |
513 | </p>\r | |
514 | </dd>\r | |
515 | </dl>\r | |
516 | </div>\r | |
b484cbc8 | 517 | <h2><a id="viewer"></a>3. The Viewer</h2>\r |
3ad8214b JF |
518 | <div class="sectionbody">\r |
519 | <p>The display consists of a status window on the last line of the screen and one\r | |
520 | or more views. The default is to only show one view at the time but it is\r | |
521 | possible to split both the main and log view to also show the commit diff.</p>\r | |
522 | <p>If you are in the log view and press <em>Enter</em> when the current line is a commit\r | |
523 | line, such as:</p>\r | |
b484cbc8 | 524 | <div class="listingblock">\r |
3ad8214b JF |
525 | <div class="content">\r |
526 | <pre><tt>commit 4d55caff4cc89335192f3e566004b4ceef572521</tt></pre>\r | |
527 | </div></div>\r | |
528 | <p>You will split the view so that the log view is displayed in the top window\r | |
529 | and the diff view in the bottom window. You can switch between the two views\r | |
530 | by pressing <em>Tab</em>. To maximize the log view again, simply press <em>l</em>.</p>\r | |
b484cbc8 | 531 | <h3><a id="commit-id"></a>3.1. Current Head and Commit ID</h3>\r |
3ad8214b JF |
532 | <p>The viewer keeps track of both what head and commit ID you are currently\r |
533 | viewing. The commit ID will follow the cursor line and change everytime time\r | |
534 | you highlight a different commit. Whenever you reopen the diff view it will be\r | |
535 | reloaded, if the commit ID changed.</p>\r | |
536 | <p>The head ID is used when opening the main and log view to indicate from what\r | |
537 | revision to show history.</p>\r | |
b484cbc8 JF |
538 | <h3><a id="views"></a>3.2. Views</h3>\r |
539 | <p>Various <em>views</em> of a repository is presented. Each view is based on output\r | |
3ad8214b JF |
540 | from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p>\r |
541 | <dl>\r | |
542 | <dt>\r | |
543 | The main view\r | |
544 | </dt>\r | |
545 | <dd>\r | |
546 | <p>\r | |
547 | Is the default view, and it shows a one line summary of each commit\r | |
548 | in the chosen list of revisions. The summary includes commit date,\r | |
549 | author, and the first line of the log message. Additionally, any\r | |
550 | repository references, such as tags, will be shown.\r | |
551 | </p>\r | |
552 | </dd>\r | |
553 | <dt>\r | |
554 | The log view\r | |
555 | </dt>\r | |
556 | <dd>\r | |
557 | <p>\r | |
558 | Presents a more rich view of the revision log showing the whole log\r | |
559 | message and the diffstat.\r | |
560 | </p>\r | |
561 | </dd>\r | |
562 | <dt>\r | |
563 | The diff view\r | |
564 | </dt>\r | |
565 | <dd>\r | |
566 | <p>\r | |
567 | Shows either the diff of the current working tree, that is, what\r | |
568 | has changed since the last commit, or the commit diff complete\r | |
569 | with log message, diffstat and diff.\r | |
570 | </p>\r | |
571 | </dd>\r | |
572 | <dt>\r | |
573 | The pager view\r | |
574 | </dt>\r | |
575 | <dd>\r | |
576 | <p>\r | |
577 | Is used for displaying both input from stdin and output from git\r | |
578 | commands entered in the internal prompt.\r | |
579 | </p>\r | |
580 | </dd>\r | |
581 | <dt>\r | |
582 | The help view\r | |
583 | </dt>\r | |
584 | <dd>\r | |
585 | <p>\r | |
42afc55b | 586 | Displays key binding quick reference.\r |
3ad8214b JF |
587 | </p>\r |
588 | </dd>\r | |
589 | </dl>\r | |
b484cbc8 | 590 | <h3><a id="title-window"></a>3.3. Title Windows</h3>\r |
3ad8214b JF |
591 | <p>Each view has a title window which shows the name of the view, current commit\r |
592 | ID if available, and where the view is positioned:</p>\r | |
b484cbc8 | 593 | <div class="listingblock">\r |
3ad8214b JF |
594 | <div class="content">\r |
595 | <pre><tt>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)</tt></pre>\r | |
596 | </div></div>\r | |
597 | <p>By default, the title of the current view is highlighted using bold font. For\r | |
598 | long loading views (taking over 3 seconds) the time since loading started will\r | |
599 | be appended:</p>\r | |
b484cbc8 | 600 | <div class="listingblock">\r |
3ad8214b JF |
601 | <div class="content">\r |
602 | <pre><tt>[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s</tt></pre>\r | |
603 | </div></div>\r | |
604 | </div>\r | |
c3a4b3e0 | 605 | <h2><a id="keys"></a>4. Default Keybindings</h2>\r |
3ad8214b JF |
606 | <div class="sectionbody">\r |
607 | <p>Below the default key bindings are shown.</p>\r | |
b484cbc8 | 608 | <h3><a id="view-switching"></a>4.1. View Switching</h3>\r |
c3a4b3e0 JF |
609 | <div class="tableblock">\r |
610 | <table rules="none"\r | |
611 | frame="hsides"\r | |
612 | cellspacing="0" cellpadding="4">\r | |
613 | <col width="91" />\r | |
614 | <col width="788" />\r | |
615 | <thead>\r | |
616 | <tr>\r | |
617 | <th align="left">\r | |
618 | Key\r | |
619 | </th>\r | |
620 | <th align="left">\r | |
621 | Action\r | |
622 | </th>\r | |
623 | </tr>\r | |
624 | </thead>\r | |
625 | <tbody valign="top">\r | |
626 | <tr>\r | |
627 | <td align="left">\r | |
628 | m\r | |
629 | </td>\r | |
630 | <td align="left">\r | |
631 | Switch to main view.\r | |
632 | </td>\r | |
633 | </tr>\r | |
634 | <tr>\r | |
635 | <td align="left">\r | |
636 | d\r | |
637 | </td>\r | |
638 | <td align="left">\r | |
639 | Switch to diff view.\r | |
640 | </td>\r | |
641 | </tr>\r | |
642 | <tr>\r | |
643 | <td align="left">\r | |
644 | l\r | |
645 | </td>\r | |
646 | <td align="left">\r | |
647 | Switch to log view.\r | |
648 | </td>\r | |
649 | </tr>\r | |
650 | <tr>\r | |
651 | <td align="left">\r | |
652 | p\r | |
653 | </td>\r | |
654 | <td align="left">\r | |
655 | Switch to pager view.\r | |
656 | </td>\r | |
657 | </tr>\r | |
658 | <tr>\r | |
659 | <td align="left">\r | |
660 | h, ?\r | |
661 | </td>\r | |
662 | <td align="left">\r | |
663 | Show man page.\r | |
664 | </td>\r | |
665 | </tr>\r | |
666 | </tbody>\r | |
667 | </table>\r | |
668 | </div>\r | |
b484cbc8 | 669 | <h3><a id="view-manipulation"></a>4.2. View Manipulation</h3>\r |
c3a4b3e0 JF |
670 | <div class="tableblock">\r |
671 | <table rules="none"\r | |
672 | frame="hsides"\r | |
673 | cellspacing="0" cellpadding="4">\r | |
674 | <col width="91" />\r | |
675 | <col width="788" />\r | |
676 | <thead>\r | |
677 | <tr>\r | |
678 | <th align="left">\r | |
679 | Key\r | |
680 | </th>\r | |
681 | <th align="left">\r | |
682 | Action\r | |
683 | </th>\r | |
684 | </tr>\r | |
685 | </thead>\r | |
686 | <tbody valign="top">\r | |
687 | <tr>\r | |
688 | <td align="left">\r | |
689 | q\r | |
690 | </td>\r | |
691 | <td align="left">\r | |
692 | Close view, if multiple views are open it will jump back to the previous view in the view stack. If it is the last open view it will quit. Use <em>Q</em> to quit all views at once.\r | |
693 | </td>\r | |
694 | </tr>\r | |
695 | <tr>\r | |
696 | <td align="left">\r | |
697 | Enter\r | |
698 | </td>\r | |
699 | <td align="left">\r | |
700 | This key is "context sensitive" depending on what view you are currently in. When in log view on a commit line or in the main view, split the view and show the commit diff. In the diff view pressing Enter will simply scroll the view one line down.\r | |
701 | </td>\r | |
702 | </tr>\r | |
703 | <tr>\r | |
704 | <td align="left">\r | |
705 | Tab\r | |
706 | </td>\r | |
707 | <td align="left">\r | |
708 | Switch to next view.\r | |
709 | </td>\r | |
710 | </tr>\r | |
711 | <tr>\r | |
712 | <td align="left">\r | |
713 | Up\r | |
714 | </td>\r | |
715 | <td align="left">\r | |
716 | This key is "context sensitive" and will move the cursor one line up. However, uf you opened a diff view from the main view (split- or full-screen) it will change the cursor to point to the previous commit in the main view and update the diff view to display it.\r | |
717 | </td>\r | |
718 | </tr>\r | |
719 | <tr>\r | |
720 | <td align="left">\r | |
721 | Down\r | |
722 | </td>\r | |
723 | <td align="left">\r | |
724 | Similar to <em>Up</em> but will move down.\r | |
725 | </td>\r | |
726 | </tr>\r | |
727 | </tbody>\r | |
728 | </table>\r | |
729 | </div>\r | |
b484cbc8 | 730 | <h3><a id="cursor-nav"></a>4.3. Cursor Navigation</h3>\r |
c3a4b3e0 JF |
731 | <div class="tableblock">\r |
732 | <table rules="none"\r | |
733 | frame="hsides"\r | |
734 | cellspacing="0" cellpadding="4">\r | |
735 | <col width="91" />\r | |
736 | <col width="788" />\r | |
737 | <thead>\r | |
738 | <tr>\r | |
739 | <th align="left">\r | |
740 | Key\r | |
741 | </th>\r | |
742 | <th align="left">\r | |
743 | Action\r | |
744 | </th>\r | |
745 | </tr>\r | |
746 | </thead>\r | |
747 | <tbody valign="top">\r | |
748 | <tr>\r | |
749 | <td align="left">\r | |
750 | j\r | |
751 | </td>\r | |
752 | <td align="left">\r | |
753 | Move cursor one line up.\r | |
754 | </td>\r | |
755 | </tr>\r | |
756 | <tr>\r | |
757 | <td align="left">\r | |
758 | k\r | |
759 | </td>\r | |
760 | <td align="left">\r | |
761 | Move cursor one line down.\r | |
762 | </td>\r | |
763 | </tr>\r | |
764 | <tr>\r | |
765 | <td align="left">\r | |
766 | PgUp b a\r | |
767 | </td>\r | |
768 | <td align="left">\r | |
769 | Move cursor one page up.\r | |
770 | </td>\r | |
771 | </tr>\r | |
772 | <tr>\r | |
773 | <td align="left">\r | |
774 | PgDown\r | |
775 | </td>\r | |
776 | <td align="left">\r | |
777 | Space Move cursor one page down.\r | |
778 | </td>\r | |
779 | </tr>\r | |
780 | <tr>\r | |
781 | <td align="left">\r | |
782 | Home\r | |
783 | </td>\r | |
784 | <td align="left">\r | |
785 | Jump to first line.\r | |
786 | </td>\r | |
787 | </tr>\r | |
788 | <tr>\r | |
789 | <td align="left">\r | |
790 | End\r | |
791 | </td>\r | |
792 | <td align="left">\r | |
793 | Jump to last line.\r | |
794 | </td>\r | |
795 | </tr>\r | |
796 | </tbody>\r | |
797 | </table>\r | |
798 | </div>\r | |
b484cbc8 | 799 | <h3><a id="view-scrolling"></a>4.4. Scrolling</h3>\r |
c3a4b3e0 JF |
800 | <div class="tableblock">\r |
801 | <table rules="none"\r | |
802 | frame="hsides"\r | |
803 | cellspacing="0" cellpadding="4">\r | |
804 | <col width="91" />\r | |
805 | <col width="788" />\r | |
806 | <thead>\r | |
807 | <tr>\r | |
808 | <th align="left">\r | |
809 | Key\r | |
810 | </th>\r | |
811 | <th align="left">\r | |
812 | Action\r | |
813 | </th>\r | |
814 | </tr>\r | |
815 | </thead>\r | |
816 | <tbody valign="top">\r | |
817 | <tr>\r | |
818 | <td align="left">\r | |
819 | Insert\r | |
820 | </td>\r | |
821 | <td align="left">\r | |
822 | Scroll view one line up.\r | |
823 | </td>\r | |
824 | </tr>\r | |
825 | <tr>\r | |
826 | <td align="left">\r | |
827 | Delete\r | |
828 | </td>\r | |
829 | <td align="left">\r | |
830 | Scroll view one line down.\r | |
831 | </td>\r | |
832 | </tr>\r | |
833 | <tr>\r | |
834 | <td align="left">\r | |
835 | w\r | |
836 | </td>\r | |
837 | <td align="left">\r | |
838 | Scroll view one page up.\r | |
839 | </td>\r | |
840 | </tr>\r | |
841 | <tr>\r | |
842 | <td align="left">\r | |
843 | s\r | |
844 | </td>\r | |
845 | <td align="left">\r | |
846 | Scroll view one page down.\r | |
847 | </td>\r | |
848 | </tr>\r | |
849 | </tbody>\r | |
850 | </table>\r | |
851 | </div>\r | |
b484cbc8 | 852 | <h3><a id="misc-keys"></a>4.5. Misc</h3>\r |
c3a4b3e0 JF |
853 | <div class="tableblock">\r |
854 | <table rules="none"\r | |
855 | frame="hsides"\r | |
856 | cellspacing="0" cellpadding="4">\r | |
857 | <col width="91" />\r | |
858 | <col width="788" />\r | |
859 | <thead>\r | |
860 | <tr>\r | |
861 | <th align="left">\r | |
862 | Key\r | |
863 | </th>\r | |
864 | <th align="left">\r | |
865 | Action\r | |
866 | </th>\r | |
867 | </tr>\r | |
868 | </thead>\r | |
869 | <tbody valign="top">\r | |
870 | <tr>\r | |
871 | <td align="left">\r | |
872 | Q\r | |
873 | </td>\r | |
874 | <td align="left">\r | |
875 | Quit.\r | |
876 | </td>\r | |
877 | </tr>\r | |
878 | <tr>\r | |
879 | <td align="left">\r | |
880 | r\r | |
881 | </td>\r | |
882 | <td align="left">\r | |
883 | Redraw screen.\r | |
884 | </td>\r | |
885 | </tr>\r | |
886 | <tr>\r | |
887 | <td align="left">\r | |
888 | z\r | |
889 | </td>\r | |
890 | <td align="left">\r | |
891 | Stop all background loading. This can be useful if you use tig in a repository with a long history without limiting the revision log.\r | |
892 | </td>\r | |
893 | </tr>\r | |
894 | <tr>\r | |
895 | <td align="left">\r | |
896 | v\r | |
897 | </td>\r | |
898 | <td align="left">\r | |
899 | Show version.\r | |
900 | </td>\r | |
901 | </tr>\r | |
902 | <tr>\r | |
903 | <td align="left">\r | |
904 | n\r | |
905 | </td>\r | |
906 | <td align="left">\r | |
907 | Toggle line numbers on/off.\r | |
908 | </td>\r | |
909 | </tr>\r | |
910 | <tr>\r | |
911 | <td align="left">\r | |
912 | g\r | |
913 | </td>\r | |
914 | <td align="left">\r | |
915 | Toggle revision graph visualization on/off.\r | |
916 | </td>\r | |
917 | </tr>\r | |
918 | <tr>\r | |
919 | <td align="left">\r | |
920 | <em>:</em>\r | |
921 | </td>\r | |
922 | <td align="left">\r | |
923 | Open prompt. This allows you to specify what git command to run. Example <tt>:log -p</tt>\r | |
924 | </td>\r | |
925 | </tr>\r | |
926 | </tbody>\r | |
927 | </table>\r | |
928 | </div>\r | |
3ad8214b | 929 | </div>\r |
b484cbc8 | 930 | <h2><a id="refspec"></a>5. Revision Specification</h2>\r |
3ad8214b JF |
931 | <div class="sectionbody">\r |
932 | <p>This section describes various ways to specify what revisions to display or\r | |
b484cbc8 | 933 | otherwise limit the view to. Tig does not itself parse the described\r |
3ad8214b JF |
934 | revision options so refer to the relevant git man pages for futher\r |
935 | information. Relevant man pages besides git-log(1) are git-diff(1) and\r | |
936 | git-rev-list(1).</p>\r | |
937 | <p>You can tune the interaction with git by making use of the options explained\r | |
938 | in this section. For example, by configuring the environment variables\r | |
939 | described in the <a href="#history-commands">"History commands"</a> section.</p>\r | |
b484cbc8 | 940 | <h3><a id="path-limiting"></a>5.1. Limit by Path Name</h3>\r |
3ad8214b JF |
941 | <p>If you are interested only in those revisions that made changes to a specific\r |
942 | file (or even several files) list the files like this:</p>\r | |
b484cbc8 | 943 | <div class="listingblock">\r |
3ad8214b JF |
944 | <div class="content">\r |
945 | <pre><tt>$ tig log Makefile README</tt></pre>\r | |
946 | </div></div>\r | |
947 | <p>To avoid ambiguity with repository references such as tag name, be sure to\r | |
948 | separate file names from other git options using "--". So if you have a file\r | |
949 | named <em>master</em> it will clash with the reference named <em>master</em>, and thus you\r | |
950 | will have to use:</p>\r | |
b484cbc8 | 951 | <div class="listingblock">\r |
3ad8214b JF |
952 | <div class="content">\r |
953 | <pre><tt>$ tig log -- master</tt></pre>\r | |
954 | </div></div>\r | |
955 | <div class="admonitionblock">\r | |
956 | <table><tr>\r | |
957 | <td class="icon">\r | |
958 | <div class="title">Note</div>\r | |
959 | </td>\r | |
960 | <td class="content">For the main view, avoiding ambiguity will in some cases require you to\r | |
b484cbc8 | 961 | specify two "--" options. The first will make tig stop option processing\r |
3ad8214b JF |
962 | and the latter will be passed to git log.</td>\r |
963 | </tr></table>\r | |
964 | </div>\r | |
b484cbc8 | 965 | <h3><a id="date-number-limiting"></a>5.2. Limit by Date or Number</h3>\r |
3ad8214b JF |
966 | <p>To speed up interaction with git, you can limit the amount of commits to show\r |
967 | both for the log and main view. Either limit by date using e.g.\r | |
968 | <tt>—since=1.month</tt> or limit by the number of commits using <tt>-n400</tt>.</p>\r | |
969 | <p>If you are only interested in changed that happened between two dates you can\r | |
970 | use:</p>\r | |
b484cbc8 | 971 | <div class="listingblock">\r |
3ad8214b JF |
972 | <div class="content">\r |
973 | <pre><tt>$ tig -- --after="May 5th" --before="2006-05-16 15:44"</tt></pre>\r | |
974 | </div></div>\r | |
975 | <div class="admonitionblock">\r | |
976 | <table><tr>\r | |
977 | <td class="icon">\r | |
978 | <div class="title">Note</div>\r | |
979 | </td>\r | |
980 | <td class="content">If you want to avoid having to quote dates containing spaces you can use\r | |
981 | "." instead, e.g. <tt>—after=May.5th</tt>.</td>\r | |
982 | </tr></table>\r | |
983 | </div>\r | |
b484cbc8 | 984 | <h3><a id="commit-range-limiting"></a>5.3. Limiting by Commit Ranges</h3>\r |
3ad8214b JF |
985 | <p>Alternatively, commits can be limited to a specific range, such as "all\r |
986 | commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p>\r | |
b484cbc8 | 987 | <div class="listingblock">\r |
3ad8214b JF |
988 | <div class="content">\r |
989 | <pre><tt>$ tig log tag-1.0..tag-2.0</tt></pre>\r | |
990 | </div></div>\r | |
991 | <p>This way of commit limiting makes it trivial to only browse the commits which\r | |
992 | haven't been pushed to a remote branch. Assuming <em>origin</em> is your upstream\r | |
993 | remote branch, using:</p>\r | |
b484cbc8 | 994 | <div class="listingblock">\r |
3ad8214b JF |
995 | <div class="content">\r |
996 | <pre><tt>$ tig log origin..HEAD</tt></pre>\r | |
997 | </div></div>\r | |
998 | <p>will list what will be pushed to the remote branch. Optionally, the ending\r | |
999 | <em>HEAD</em> can be left out since it is implied.</p>\r | |
b484cbc8 | 1000 | <h3><a id="reachability-limiting"></a>5.4. Limiting by Reachability</h3>\r |
3ad8214b JF |
1001 | <p>Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits\r |
1002 | reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>". Where reachability refers\r | |
1003 | to what commits are ancestors (or part of the history) of the branch or tagged\r | |
1004 | revision in question.</p>\r | |
1005 | <p>If you prefer to specify which commit to preview in this way use the\r | |
1006 | following:</p>\r | |
b484cbc8 | 1007 | <div class="listingblock">\r |
3ad8214b JF |
1008 | <div class="content">\r |
1009 | <pre><tt>$ tig log tag-2.0 ^tag-1.0</tt></pre>\r | |
1010 | </div></div>\r | |
1011 | <p>You can think of <em>^</em> as a negation operator. Using this alternate syntax, it\r | |
1012 | is possible to further prune commits by specifying multiple branch cut offs.</p>\r | |
b484cbc8 | 1013 | <h3><a id="refspec-combi"></a>5.5. Combining Revisions Specification</h3>\r |
3ad8214b JF |
1014 | <p>Revisions options can to some degree be combined, which makes it possible to\r |
1015 | say "show at most 20 commits from within the last month that changed files\r | |
1016 | under the Documentation/ directory."</p>\r | |
b484cbc8 | 1017 | <div class="listingblock">\r |
3ad8214b JF |
1018 | <div class="content">\r |
1019 | <pre><tt>$ tig -- --since=1.month -n20 -- Documentation/</tt></pre>\r | |
1020 | </div></div>\r | |
b484cbc8 | 1021 | <h3><a id="refspec-all"></a>5.6. Examining All Repository References</h3>\r |
3ad8214b JF |
1022 | <p>In some cases, it can be useful to query changes across all references in a\r |
1023 | repository. An example is to ask "did any line of development in this\r | |
1024 | repository change a particular file within the last week". This can be\r | |
1025 | accomplished using:</p>\r | |
b484cbc8 | 1026 | <div class="listingblock">\r |
3ad8214b JF |
1027 | <div class="content">\r |
1028 | <pre><tt>$ tig -- --all --since=1.week -- Makefile</tt></pre>\r | |
1029 | </div></div>\r | |
1030 | </div>\r | |
b484cbc8 | 1031 | <h2>6. BUGS</h2>\r |
3ad8214b JF |
1032 | <div class="sectionbody">\r |
1033 | <p>Known bugs and problems:</p>\r | |
1034 | <ul>\r | |
1035 | <li>\r | |
1036 | <p>\r | |
1037 | In it's current state tig is pretty much UTF-8 only.\r | |
1038 | </p>\r | |
1039 | </li>\r | |
1040 | <li>\r | |
1041 | <p>\r | |
1042 | If the screen width is very small the main view can draw\r | |
1043 | outside the current view causing bad wrapping. Same goes\r | |
1044 | for title and status windows.\r | |
1045 | </p>\r | |
1046 | </li>\r | |
1047 | <li>\r | |
1048 | <p>\r | |
1049 | The cursor can wrap-around on the last line and cause the\r | |
1050 | window to scroll.\r | |
1051 | </p>\r | |
1052 | </li>\r | |
3ad8214b JF |
1053 | </ul>\r |
1054 | </div>\r | |
b484cbc8 | 1055 | <h2><a id="copy-right"></a>7. Copyright</h2>\r |
3ad8214b JF |
1056 | <div class="sectionbody">\r |
1057 | <p>Copyright (c) 2006 Jonas Fonseca <fonseca@diku.dk></p>\r | |
1058 | <p>This program is free software; you can redistribute it and/or modify\r | |
1059 | it under the terms of the GNU General Public License as published by\r | |
1060 | the Free Software Foundation; either version 2 of the License, or\r | |
1061 | (at your option) any later version.</p>\r | |
1062 | </div>\r | |
b484cbc8 | 1063 | <h2><a id="references"></a>8. References and Related Tools</h2>\r |
3ad8214b | 1064 | <div class="sectionbody">\r |
b484cbc8 JF |
1065 | <p>Manpages:</p>\r |
1066 | <ul>\r | |
1067 | <li>\r | |
1068 | <p>\r | |
1069 | <a href="tig.1.html">tig(1)</a>\r | |
1070 | </p>\r | |
1071 | </li>\r | |
1072 | <li>\r | |
1073 | <p>\r | |
1074 | <a href="tigrc.5.html">tigrc(5)</a>\r | |
1075 | </p>\r | |
1076 | </li>\r | |
1077 | </ul>\r | |
1078 | <p>Online resources:</p>\r | |
3ad8214b JF |
1079 | <ul>\r |
1080 | <li>\r | |
1081 | <p>\r | |
1082 | Homepage: <a href="http://jonas.nitro.dk/tig">http://jonas.nitro.dk/tig</a>\r | |
1083 | </p>\r | |
1084 | </li>\r | |
1085 | <li>\r | |
1086 | <p>\r | |
1087 | Releases: <a href="http://jonas.nitro.dk/tig/releases">http://jonas.nitro.dk/tig/releases</a>\r | |
1088 | </p>\r | |
1089 | </li>\r | |
1090 | <li>\r | |
1091 | <p>\r | |
1092 | Git URL: <a href="http://jonas.nitro.dk/tig/tig.git">http://jonas.nitro.dk/tig/tig.git</a>\r | |
1093 | </p>\r | |
1094 | </li>\r | |
1095 | <li>\r | |
1096 | <p>\r | |
1097 | Gitweb: <a href="http://pasky.or.cz/gitweb.cgi?p=tig.git;a=summary">http://pasky.or.cz/gitweb.cgi?p=tig.git;a=summary</a>\r | |
1098 | </p>\r | |
1099 | </li>\r | |
1100 | </ul>\r | |
1101 | <p>Git porcelains:</p>\r | |
1102 | <ul>\r | |
1103 | <li>\r | |
1104 | <p>\r | |
1105 | <a href="http://www.kernel.org/pub/software/scm/git/docs/">git</a>,\r | |
1106 | </p>\r | |
1107 | </li>\r | |
1108 | <li>\r | |
1109 | <p>\r | |
1110 | <a href="http://www.kernel.org/pub/software/scm/cogito/docs/">Cogito</a>\r | |
1111 | </p>\r | |
1112 | </li>\r | |
1113 | </ul>\r | |
1114 | <p>Other git repository browsers:</p>\r | |
1115 | <ul>\r | |
1116 | <li>\r | |
1117 | <p>\r | |
1118 | gitk(1)\r | |
1119 | </p>\r | |
1120 | </li>\r | |
1121 | <li>\r | |
1122 | <p>\r | |
1123 | qgit(1)\r | |
1124 | </p>\r | |
1125 | </li>\r | |
1126 | <li>\r | |
1127 | <p>\r | |
1128 | gitview(1)\r | |
1129 | </p>\r | |
1130 | </li>\r | |
1131 | </ul>\r | |
1132 | </div>\r | |
1133 | <div id="footer">\r | |
1134 | <div id="footer-text">\r | |
c3a4b3e0 | 1135 | Last updated 14-Jun-2006 23:28:46 CEST\r |
3ad8214b JF |
1136 | </div>\r |
1137 | </div>\r | |
1138 | </body>\r | |
1139 | </html>\r |