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