author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 9 Jun 2006 11:15:07 +0000 (13:15 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Fri, 9 Jun 2006 11:15:07 +0000 (13:15 +0200) |
Makefile | patch | blob | history | |
asciidoc.conf | [new file with mode: 0644] | patch | blob |
manual.txt | patch | blob | history | |
tig.1.txt | patch | blob | history | |
tig.c | patch | blob | history | |
tigrc | patch | blob | history | |
web.conf | [deleted file] | patch | blob | history |
diff --git a/Makefile b/Makefile
index 6d595f408d732dc96ec79841dfdfe14ca6257fe4..7bebefd44aea8618905302b3f88c387714e6a792 100644 (file)
--- a/Makefile
+++ b/Makefile
prefix = $(HOME)
bindir= $(prefix)/bin
mandir = $(prefix)/man
+docdir = $(prefix)/share/doc
# DESTDIR=
LDLIBS = -lcurses
DFLAGS = -g -DDEBUG -Werror
PROGS = tig
DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
- manual.html manual.html-chunked README.html
+ manual.toc manual.html manual.html-chunked README.html \
ifneq (,$(wildcard .git))
VERSION = $(shell git-describe)
done
install-doc: doc
- mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
+ mkdir -p $(DESTDIR)$(mandir)/man1 \
+ $(DESTDIR)$(mandir)/man5 \
+ $(DESTDIR)$(docdir)/tig
for doc in $(DOCS); do \
case "$$doc" in \
*.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
*.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
+ *.html) install $$doc $(DESTDIR)$(docdir)/tig ;; \
esac \
done
.PHONY: all all-debug doc install install-doc clean spell-check
+manual.toc: manual.txt
+ sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
+ case "$$line" in \
+ "-----"*) echo ". <<$$ref>>"; ref= ;; \
+ "~~~~~"*) echo "- <<$$ref>>"; ref= ;; \
+ "[["*"]]") ref="$$line" ;; \
+ *) ref="$$ref, $$line" ;; \
+ esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
+
tig: tig.c
README.html: README
- asciidoc -b xhtml11 -d article -f web.conf $<
+ asciidoc -b xhtml11 -d article -a readme $<
%.1.html : %.1.txt
asciidoc -b xhtml11 -d manpage $<
xmlto man $<
%.html : %.txt
- asciidoc -b xhtml11 -d article $<
+ asciidoc -b xhtml11 -d article -n $<
%.xml : %.txt
asciidoc -b docbook -d article $<
diff --git a/asciidoc.conf b/asciidoc.conf
--- /dev/null
+++ b/asciidoc.conf
@@ -0,0 +1,32 @@
+ifdef::backend-docbook[]
+[gitlink-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-docbook[]
+# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+|
+</literallayout>
+{title#}</example>
+endif::backend-docbook[]
+
+ifdef::backend-xhtml11[]
+[gitlink-inlinemacro]
+<a href="{target}{0?.{0}}.html">{target}{0?({0})}</a>
+endif::backend-xhtml11[]
+
+ifdef::readme[]
+# No header or footers for README.html
+[header]
+<div style="font-family: sans-serif;">
+<h1>{doctitle}</h1>
+
+[footer]
+</div>
+endif::readme[]
diff --git a/manual.txt b/manual.txt
index b530f1cc66fa067d765300f8128d1d4f3521b82c..637b85c1883f2ca7c08ad1e994ad4b3e072b587b 100644 (file)
--- a/manual.txt
+++ b/manual.txt
the user with various views, such as summarized commit log and showing the
commit with the log message, diffstat, and the diff.
+ifndef::backend-docbook[]
+include::manual.toc[]
+endif::backend-docbook[]
+
+[[calling-conventions]]
Calling Conventions
-------------------
+[[pager-mode]]
Pager Mode
~~~~~~~~~~
Example on how to colorize the output of git-show(1):
- $ git show | tig
+-----------------------------------------------------------------------------
+$ git show | tig
+-----------------------------------------------------------------------------
+[[cmd-options]]
Git Command Options
~~~~~~~~~~~~~~~~~~~
Example on how to open the log view and show both author and committer
information:
- $ tig log --pretty=fuller
+-----------------------------------------------------------------------------
+$ tig log --pretty=fuller
+-----------------------------------------------------------------------------
See the <<refspec, "Specifying revisions">> section below for an introduction
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.
+[[env-variables]]
Environment Variables
---------------------
Several options related to the interface with git can be configured via
environment options.
+[[repo-refs]]
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
+-----------------------------------------------------------------------------
+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
+-----------------------------------------------------------------------------
+$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig
+-----------------------------------------------------------------------------
Or set the variable permanently in your environment.
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
+-----------------------------------------------------------------------------
+$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig
+-----------------------------------------------------------------------------
Or set the variable permanently in your environment.
the option: `--pretty=raw` since the main view parser expects to
read that format.
+[[viewer]]
The Viewer
----------
If you are in the log view and press 'Enter' when the current line is a commit
line, such as:
- commit 4d55caff4cc89335192f3e566004b4ceef572521
+-----------------------------------------------------------------------------
+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'.
+[[commit-id]]
Current Head and Commit ID
~~~~~~~~~~~~~~~~~~~~~~~~~~
The head ID is used when opening the main and log view to indicate from what
revision to show history.
+[[views]]
Views
~~~~~
-tig(1) presents various 'views' of a repository. Each view is based on output
+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'.
The main view::
The help view::
Displays key binding quick reference.
+[[title-window]]
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%)
+-----------------------------------------------------------------------------
+[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
+-----------------------------------------------------------------------------
+[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s
+-----------------------------------------------------------------------------
+[[keys]]
Keys
----
Below the default key bindings are shown.
+[[view-switching]]
View Switching
~~~~~~~~~~~~~~
m::
h, ?::
Show man page.
+[[view-manipulation]]
View Manipulation
~~~~~~~~~~~~~~~~~
q::
Down::
Similar to 'Up' but will move down.
+[[cursor-nav]]
Cursor Navigation
~~~~~~~~~~~~~~~~~
j::
End::
Jump to last line.
+[[view-scrolling]]
Scrolling
~~~~~~~~~
Insert::
s::
Scroll view one page down.
+[[misc-keys]]
Misc
~~~~
Q::
Redraw screen.
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.
v::
Show version.
----------------------
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).
in this section. For example, by configuring the environment variables
described in the <<history-commands, "History commands">> section.
+[[path-limiting]]
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
+-----------------------------------------------------------------------------
+$ tig log Makefile README
+-----------------------------------------------------------------------------
To avoid ambiguity with repository references such as tag name, be sure to
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
+-----------------------------------------------------------------------------
+$ tig log -- master
+-----------------------------------------------------------------------------
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.
+[[date-number-limiting]]
Limit by Date or Number
~~~~~~~~~~~~~~~~~~~~~~~
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"
+-----------------------------------------------------------------------------
+$ tig -- --after="May 5th" --before="2006-05-16 15:44"
+-----------------------------------------------------------------------------
NOTE: If you want to avoid having to quote dates containing spaces you can use
"." instead, e.g. `--after=May.5th`.
+[[commit-range-limiting]]
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
+-----------------------------------------------------------------------------
+$ 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
+-----------------------------------------------------------------------------
+$ 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.
+[[reachability-limiting]]
Limiting by Reachability
~~~~~~~~~~~~~~~~~~~~~~~~
If you prefer to specify which commit to preview in this way use the
following:
- $ tig log tag-2.0 ^tag-1.0
+-----------------------------------------------------------------------------
+$ 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.
+[[refspec-combi]]
Combining Revisions Specification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
say "show at most 20 commits from within the last month that changed files
under the Documentation/ directory."
- $ tig -- --since=1.month -n20 -- Documentation/
+-----------------------------------------------------------------------------
+$ tig -- --since=1.month -n20 -- Documentation/
+-----------------------------------------------------------------------------
+[[refspec-all]]
Examining All Repository References
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
repository change a particular file within the last week". This can be
accomplished using:
- $ tig -- --all --since=1.week -- Makefile
+-----------------------------------------------------------------------------
+$ tig -- --all --since=1.week -- Makefile
+-----------------------------------------------------------------------------
include::BUGS[]
+[[copy-right]]
Copyright
---------
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
+[[references]]
References and Related Tools
----------------------------
+Manpages:
+
+ - gitlink:tig[1]
+ - gitlink:tigrc[5]
+
+Online resources:
+
include::SITES[]
Git porcelains:
diff --git a/tig.1.txt b/tig.1.txt
index aca40cbb06cf5953cb50978eb662c2fb090d87f3..b0cafd8180ddb20a09fcbdb22dd6c474611594e5 100644 (file)
--- a/tig.1.txt
+++ b/tig.1.txt
FILES
-----
'~/.tigrc'::
- User configuration file. See tigrc(5) for examples.
+ User configuration file. See gitlink:tigrc[5] for examples.
'.git/config'::
Repository config file. Read on startup with the help of
SEE ALSO
--------
+
+- gitlink:tigrc[5]
+- link:http://jonas.nitro.dk/tig/manual.html[The tig manual],
- link:http://www.kernel.org/pub/software/scm/git/docs/[git(7)],
- link:http://www.kernel.org/pub/software/scm/cogito/docs/[cogito(7)]
index 8a14cb37ebb8d3007f0159cf094f6b75ccd2383f..cf65447cb5320508af6147b38e27c3f3bc6df127 100644 (file)
--- a/tig.c
+++ b/tig.c
return OK;
}
- if (!strcmp(argv[0], "encoding")) {
+ if (!strcmp(argv[0], "commit-encoding")) {
string_copy(opt_encoding, argv[2]);
return OK;
}
index fa08c5badc725ff2a19a99bcc0f984afeac50391..58e045667a7a0c0bf3708de9048ea166c4685ef6 100644 (file)
--- a/tigrc
+++ b/tigrc
set show-rev-graph = yes # Show revision graph?
set line-number-interval = 5 # Interval between line numbers
set tab-size = 8 # Number of spaces pr tab
-set encoding = UTF-8 # Commit encoding
+set commit-encoding = UTF-8 # Commit encoding
#
# Key configuration
diff --git a/web.conf b/web.conf
--- a/web.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-# No header or footers for README.html
-[header]
-<div style="font-family: sans-serif;">
-<h1>{doctitle}</h1>
-
-[footer]
-</div>