summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fff1780)
raw | patch | inline | side by side (parent: fff1780)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 1 Jun 2006 00:16:16 +0000 (02:16 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Thu, 1 Jun 2006 00:16:16 +0000 (02:16 +0200) |
Makefile | patch | blob | history | |
tig.1.txt | [new file with mode: 0644] | patch | blob |
tig.c | patch | blob | history |
diff --git a/Makefile b/Makefile
index fb8f53a28be9c47dbfa3ac51743953c83beef278..a7ff69bb3ca8e1ac16f17302138ab46bb371b4e2 100644 (file)
--- a/Makefile
+++ b/Makefile
CFLAGS = -Wall -O2
DFLAGS = -g -DDEBUG -Werror
PROGS = tig
-DOCS = tig.1.txt tig.1.html tig.1 tigrc.5.html tigrc.5 \
+DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
manual.html manual.html-chunked README.html
ifneq (,$(wildcard .git))
rm -f $(PROGS) $(DOCS) core
spell-check:
- aspell --lang=en --check tig.1.txt
+ aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
.PHONY: all all-debug doc install install-doc clean spell-check
tig: tig.c
-tig.1.txt: tig.c
- sed -n '/\/\*\*/,/\*\*\//p' < $< | \
- sed 's/.*\*\*\/.*//' | \
- sed '/^[^*]*\*\*/d' | \
- sed 's/\*\///;s/^[^*]*\* *//' > $@
-
README.html: README
asciidoc -b xhtml11 -d article -f web.conf $<
diff --git a/tig.1.txt b/tig.1.txt
--- /dev/null
+++ b/tig.1.txt
@@ -0,0 +1,129 @@
+TIG(1)
+======
+
+NAME
+----
+tig - text-mode interface for git
+
+SYNOPSIS
+--------
+[verse]
+tig [options]
+tig [options] [--] [git log options]
+tig [options] log [git log options]
+tig [options] diff [git diff options]
+tig [options] show [git show options]
+tig [options] < [git command output]
+
+DESCRIPTION
+-----------
+Browse changes in a git repository. Additionally, tig(1) can also act
+as a pager for output of various git commands.
+
+When browsing repositories, tig(1) 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.
+
+Using tig(1) as a pager, it will display input from stdin and try
+to colorize it.
+
+OPTIONS
+-------
+
+-l::
+ Start up in log view using the internal log command.
+
+-d::
+ Start up in diff view using the internal diff command.
+
+-n[INTERVAL], --line-number[=INTERVAL]::
+ Prefix line numbers in log and diff view.
+ Optionally, with interval different than each line.
+
+-b[NSPACES], --tab-size[=NSPACES]::
+ Set the number of spaces tabs should be expanded to.
+
+-v, --version::
+ Show version and exit.
+
+-h, --help::
+ Show help message and exit.
+
+\--::
+ End of tig(1) options. Useful when specifying command
+ options for the main view. Example:
+
+ $ tig -- --since=1.month
+
+log [git log options]::
+ Open log view using the given git log options.
+
+diff [git diff options]::
+ Open diff view using the given git diff options.
+
+show [git show options]::
+ Open diff view using the given git show options.
+
+[git log options]::
+ tig(1) will stop the option parsing when the first
+ command line parameter not starting with "-" is
+ encountered. All options including this one will be
+ passed to git log when loading the main view.
+ This makes it possible to say:
+
+ $ tig tag-1.0..HEAD
+
+ENVIRONMENT VARIABLES
+---------------------
+TIG_LS_REMOTE::
+ Set command for retrieving all repository references. The command
+ should output data in the same format as git-ls-remote(1).
+
+TIG_DIFF_CMD::
+ The command used for the diff view. By default, git show is used
+ as a backend.
+
+TIG_LOG_CMD::
+ The command used for the log view. If you prefer to have both
+ author and committer shown in the log view be sure to pass
+ `--pretty=fuller` to git log.
+
+TIG_MAIN_CMD::
+ The command used for the main view. Note, you must always specify
+ the option: `--pretty=raw` since the main view parser expects to
+ read that format.
+
+FILES
+-----
+'~/.tigrc'::
+ User configuration file. See tigrc(5) for examples.
+
+'.git/config'::
+ Repository config file. Read on startup with the help of
+ git-repo-config(1).
+
+include::BUGS[]
+
+COPYRIGHT
+---------
+Copyright (c) 2006 Jonas Fonseca <fonseca@diku.dk>
+
+This program is free software; you can redistribute it and/or modify
+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.
+
+SEE ALSO
+--------
+- link:http://www.kernel.org/pub/software/scm/git/docs/[git(7)],
+- link:http://www.kernel.org/pub/software/scm/cogito/docs/[cogito(7)]
+
+Other git repository browsers:
+
+- gitk(1)
+- qgit(1)
+- gitview(1)
+
+Sites:
+
+include::SITES[]
index 851503f72a695eefc16d958a57b952b3b2494df0..859681c3fc56c24db09edd3a5570191c2e93d3c1 100644 (file)
--- a/tig.c
+++ b/tig.c
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
-/**
- * TIG(1)
- * ======
- *
- * NAME
- * ----
- * tig - text-mode interface for git
- *
- * SYNOPSIS
- * --------
- * [verse]
- * tig [options]
- * tig [options] [--] [git log options]
- * tig [options] log [git log options]
- * tig [options] diff [git diff options]
- * tig [options] show [git show options]
- * tig [options] < [git command output]
- *
- * DESCRIPTION
- * -----------
- * Browse changes in a git repository. Additionally, tig(1) can also act
- * as a pager for output of various git commands.
- *
- * When browsing repositories, tig(1) 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.
- *
- * Using tig(1) as a pager, it will display input from stdin and try
- * to colorize it.
- **/
#ifndef VERSION
#define VERSION "tig-0.3"
#define SCALE_SPLIT_VIEW(height) ((height) * 2 / 3)
+#define TIG_LS_REMOTE \
+ "git ls-remote . 2>/dev/null"
+
+#define TIG_DIFF_CMD \
+ "git show --patch-with-stat --find-copies-harder -B -C %s"
+
+#define TIG_LOG_CMD \
+ "git log --cc --stat -n100 %s"
+
+#define TIG_MAIN_CMD \
+ "git log --topo-order --stat --pretty=raw %s"
+
+/* XXX: Needs to be defined to the empty string. */
+#define TIG_HELP_CMD ""
+#define TIG_PAGER_CMD ""
+
/* Some ascii-shorthands fitted into the ncurses namespace. */
#define KEY_TAB '\t'
#define KEY_RETURN '\r'
#undef REQ_
};
-/**
- * OPTIONS
- * -------
- **/
+/*
+ * Options
+ */
static const char usage[] =
VERSION " (" __DATE__ ")\n"
for (i = 1; i < argc; i++) {
char *opt = argv[i];
- /**
- * -l::
- * Start up in log view using the internal log command.
- **/
if (!strcmp(opt, "-l")) {
opt_request = REQ_VIEW_LOG;
continue;
}
- /**
- * -d::
- * Start up in diff view using the internal diff command.
- **/
if (!strcmp(opt, "-d")) {
opt_request = REQ_VIEW_DIFF;
continue;
}
- /**
- * -n[INTERVAL], --line-number[=INTERVAL]::
- * Prefix line numbers in log and diff view.
- * Optionally, with interval different than each line.
- **/
if (!strncmp(opt, "-n", 2) ||
!strncmp(opt, "--line-number", 13)) {
char *num = opt;
continue;
}
- /**
- * -b[NSPACES], --tab-size[=NSPACES]::
- * Set the number of spaces tabs should be expanded to.
- **/
if (!strncmp(opt, "-b", 2) ||
!strncmp(opt, "--tab-size", 10)) {
char *num = opt;
continue;
}
- /**
- * -v, --version::
- * Show version and exit.
- **/
if (!strcmp(opt, "-v") ||
!strcmp(opt, "--version")) {
printf("tig version %s\n", VERSION);
return FALSE;
}
- /**
- * -h, --help::
- * Show help message and exit.
- **/
if (!strcmp(opt, "-h") ||
!strcmp(opt, "--help")) {
printf(usage);
return FALSE;
}
- /**
- * \--::
- * End of tig(1) options. Useful when specifying command
- * options for the main view. Example:
- *
- * $ tig -- --since=1.month
- **/
if (!strcmp(opt, "--")) {
i++;
break;
}
- /**
- * log [git log options]::
- * Open log view using the given git log options.
- *
- * diff [git diff options]::
- * Open diff view using the given git diff options.
- *
- * show [git show options]::
- * Open diff view using the given git show options.
- **/
if (!strcmp(opt, "log") ||
!strcmp(opt, "diff") ||
!strcmp(opt, "show")) {
break;
}
- /**
- * [git log options]::
- * tig(1) will stop the option parsing when the first
- * command line parameter not starting with "-" is
- * encountered. All options including this one will be
- * passed to git log when loading the main view.
- * This makes it possible to say:
- *
- * $ tig tag-1.0..HEAD
- **/
if (opt[0] && opt[0] != '-')
break;
}
-/**
- * ENVIRONMENT VARIABLES
- * ---------------------
- * TIG_LS_REMOTE::
- * Set command for retrieving all repository references. The command
- * should output data in the same format as git-ls-remote(1).
- **/
-
-#define TIG_LS_REMOTE \
- "git ls-remote . 2>/dev/null"
-
-/**
- * TIG_DIFF_CMD::
- * The command used for the diff view. By default, git show is used
- * as a backend.
- *
- * TIG_LOG_CMD::
- * The command used for the log view. If you prefer to have both
- * author and committer shown in the log view be sure to pass
- * `--pretty=fuller` to git log.
- *
- * TIG_MAIN_CMD::
- * The command used for the main view. Note, you must always specify
- * the option: `--pretty=raw` since the main view parser expects to
- * read that format.
- **/
-
-#define TIG_DIFF_CMD \
- "git show --patch-with-stat --find-copies-harder -B -C %s"
-
-#define TIG_LOG_CMD \
- "git log --cc --stat -n100 %s"
-
-#define TIG_MAIN_CMD \
- "git log --topo-order --stat --pretty=raw %s"
-
-/* ... silently ignore that the following are also exported. */
-
-#define TIG_HELP_CMD \
- ""
-
-#define TIG_PAGER_CMD \
- ""
-
-
-/**
- * FILES
- * -----
- * '~/.tigrc'::
- * User configuration file. See tigrc(5) for examples.
- *
- * '.git/config'::
- * Repository config file. Read on startup with the help of
- * git-repo-config(1).
- **/
-
static struct int_map color_map[] = {
#define COLOR_MAP(name) { #name, STRING_SIZE(#name), COLOR_##name }
COLOR_MAP(DEFAULT),
return 0;
}
-
-/**
- * include::BUGS[]
- *
- * COPYRIGHT
- * ---------
- * Copyright (c) 2006 Jonas Fonseca <fonseca@diku.dk>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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.
- *
- * SEE ALSO
- * --------
- * - link:http://www.kernel.org/pub/software/scm/git/docs/[git(7)],
- * - link:http://www.kernel.org/pub/software/scm/cogito/docs/[cogito(7)]
- *
- * Other git repository browsers:
- *
- * - gitk(1)
- * - qgit(1)
- * - gitview(1)
- *
- * Sites:
- *
- * include::SITES[]
- **/