X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/tig/blobdiff_plain/daaae1af3f1fe5a18a106e5c42ac6ef6fa4fa9d2..b484cbc84ae8fc3d2241e56c0048de9d99d650b8:/manual.html diff --git a/manual.html b/manual.html index 63ac2c4..0f787e7 100644 --- a/manual.html +++ b/manual.html @@ -272,20 +272,146 @@ display input from stdin and colorize it.

When browsing repositories, tig uses the underlying git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff.

+

Table of Contents

+
    +
  1. +

    +Calling Conventions +

    + +
  2. +
  3. +

    +Environment Variables +

    + +
  4. +
  5. +

    +The Viewer +

    + +
  6. +
  7. +

    +Revision Specification +

    + +
  8. +
  9. +

    +Copyright +

    +
  10. +
  11. +

    +References and Related Tools +

    +
  12. +
-

Calling Conventions

+

1. Calling Conventions

-

Pager Mode

+

1.1. Pager Mode

If stdin is a pipe, any log or diff options will be ignored and the pager view will be opened loading data from stdin. The pager mode can be used for colorizing output from various git commands.

Example on how to colorize the output of git-show(1):

-
+
$ git show | tig
-

Git Command Options

+

1.2. Git Command Options

All git command options specified on the command line will be passed to the given command and all will be shell quoted before they are passed to the shell.

@@ -301,7 +427,7 @@ expected by the main view.

Example on how to open the log view and show both author and committer information:

-
+
$ tig log --pretty=fuller
@@ -309,20 +435,20 @@ information:

to revision options supported by the git commands. For details on specific git command options, refer to the man page of the command in question.

-

Environment Variables

+

2. Environment Variables

Several options related to the interface with git can be configured via environment options.

-

Repository References

+

2.1. Repository References

Commits that are referenced by tags and branch heads will be marked by the reference name surrounded by [ and ]:

-
+
2006-03-26 19:42 Petr Baudis         | [cogito-0.17.1] Cogito 0.17.1

If you want to filter out certain directories under .git/refs/, say tmp you can do it by setting the following variable:

-
+
$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig
@@ -338,11 +464,11 @@ TIG_LS_REMOTE

-

History Commands

+

2.2. History Commands

It is possible to alter which commands are used for the different views. If for example you prefer commits in the main view to be sorted by date and only show 500 commits, use:

-
+
$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig
@@ -381,29 +507,29 @@ TIG_MAIN_CMD
-

The Viewer

+

3. The Viewer

The display consists of a status window on the last line of the screen and one or more views. The default is to only show one view at the time but it is possible to split both the main and log view to also show the commit diff.

If you are in the log view and press Enter when the current line is a commit line, such as:

-
+
commit 4d55caff4cc89335192f3e566004b4ceef572521

You will split the view so that the log view is displayed in the top window and the diff view in the bottom window. You can switch between the two views by pressing Tab. To maximize the log view again, simply press l.

-

Current Head and Commit ID

+

3.1. Current Head and Commit ID

The viewer keeps track of both what head and commit ID you are currently viewing. The commit ID will follow the cursor line and change everytime time you highlight a different commit. Whenever you reopen the diff view it will be reloaded, if the commit ID changed.

The head ID is used when opening the main and log view to indicate from what revision to show history.

-

Views

-

tig(1) presents various views of a repository. Each view is based on output +

3.2. Views

+

Various views of a repository is presented. Each view is based on output from an external command, most often git log, git diff, or git show.

@@ -454,25 +580,25 @@ The help view

-

Title Windows

+

3.3. Title Windows

Each view has a title window which shows the name of the view, current commit ID if available, and where the view is positioned:

-
+
[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)

By default, the title of the current view is highlighted using bold font. For long loading views (taking over 3 seconds) the time since loading started will be appended:

-
+
[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s
-

Keys

+

4. Keys

Below the default key bindings are shown.

-

View Switching

+

4.1. View Switching

m @@ -515,7 +641,7 @@ h, ?

-

View Manipulation

+

4.2. View Manipulation

q @@ -567,7 +693,7 @@ Down

-

Cursor Navigation

+

4.3. Cursor Navigation

j @@ -627,7 +753,7 @@ End

-

Scrolling

+

4.4. Scrolling

Insert @@ -662,7 +788,7 @@ s

-

Misc

+

4.5. Misc

Q @@ -686,7 +812,7 @@ z

Stop all background loading. This can be useful if you use - tig(1) in a repository with a long history without limiting + tig in a repository with a long history without limiting the revision log.

@@ -729,20 +855,20 @@ g
-

Revision Specification

+

5. Revision Specification

This section describes various ways to specify what revisions to display or -otherwise limit the view to. tig(1) does not itself parse the described +otherwise limit the view to. Tig does not itself parse the described revision options so refer to the relevant git man pages for futher information. Relevant man pages besides git-log(1) are git-diff(1) and git-rev-list(1).

You can tune the interaction with git by making use of the options explained in this section. For example, by configuring the environment variables described in the "History commands" section.

-

Limit by Path Name

+

5.1. Limit by Path Name

If you are interested only in those revisions that made changes to a specific file (or even several files) list the files like this:

-
+
$ tig log Makefile README
@@ -750,7 +876,7 @@ file (or even several files) list the files like this:

separate file names from other git options using "--". So if you have a file named master it will clash with the reference named master, and thus you will have to use:

-
+
$ tig log -- master
@@ -760,17 +886,17 @@ will have to use:

Note
For the main view, avoiding ambiguity will in some cases require you to -specify two "--" options. The first will make tig(1) stop option processing +specify two "--" options. The first will make tig stop option processing and the latter will be passed to git log.
-

Limit by Date or Number

+

5.2. Limit by Date or Number

To speed up interaction with git, you can limit the amount of commits to show both for the log and main view. Either limit by date using e.g. —since=1.month or limit by the number of commits using -n400.

If you are only interested in changed that happened between two dates you can use:

-
+
$ tig -- --after="May 5th" --before="2006-05-16 15:44"
@@ -783,54 +909,54 @@ use:

"." instead, e.g. —after=May.5th.
-

Limiting by Commit Ranges

+

5.3. Limiting by Commit Ranges

Alternatively, commits can be limited to a specific range, such as "all commits between tag-1.0 and tag-2.0". For example:

-
+
$ tig log tag-1.0..tag-2.0

This way of commit limiting makes it trivial to only browse the commits which haven't been pushed to a remote branch. Assuming origin is your upstream remote branch, using:

-
+
$ tig log origin..HEAD

will list what will be pushed to the remote branch. Optionally, the ending HEAD can be left out since it is implied.

-

Limiting by Reachability

+

5.4. Limiting by Reachability

Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits reachable from tag-2.0 but not from tag-1.0". Where reachability refers to what commits are ancestors (or part of the history) of the branch or tagged revision in question.

If you prefer to specify which commit to preview in this way use the following:

-
+
$ tig log tag-2.0 ^tag-1.0

You can think of ^ as a negation operator. Using this alternate syntax, it is possible to further prune commits by specifying multiple branch cut offs.

-

Combining Revisions Specification

+

5.5. Combining Revisions Specification

Revisions options can to some degree be combined, which makes it possible to say "show at most 20 commits from within the last month that changed files under the Documentation/ directory."

-
+
$ tig -- --since=1.month -n20 -- Documentation/
-

Examining All Repository References

+

5.6. Examining All Repository References

In some cases, it can be useful to query changes across all references in a repository. An example is to ask "did any line of development in this repository change a particular file within the last week". This can be accomplished using:

-
+
$ tig -- --all --since=1.week -- Makefile
-

BUGS

+

6. BUGS

Known bugs and problems:

    @@ -852,14 +978,9 @@ The cursor can wrap-around on the last line and cause the window to scroll.

    -
  • -

    -The prompt doesn't work while loading. -

    -
-

Copyright

+

7. Copyright

Copyright (c) 2006 Jonas Fonseca <fonseca@diku.dk>

This program is free software; you can redistribute it and/or modify @@ -867,8 +988,22 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

-

References and Related Tools

+

8. References and Related Tools

+

Manpages:

+ +

Online resources:

  • @@ -925,7 +1060,7 @@ gitview(1)