From cb7f42cdc1a07d0f88b8af211d214da5febd6223 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 29 May 2006 03:15:20 +0200 Subject: [PATCH] Move ~/.tigrc documentation into it's own man page, tigrc(5) --- Makefile | 12 +++++- tig.c | 114 +------------------------------------------------------- tigrc.5.txt | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 114 deletions(-) create mode 100644 tigrc.5.txt diff --git a/Makefile b/Makefile index 1d8e180..1a3dc15 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ LDLIBS = -lcurses CFLAGS = -Wall -O2 DFLAGS = -g -DDEBUG -Werror PROGS = tig -DOCS = tig.1.txt tig.1.html tig.1 README.html +DOCS = tig.1.txt tig.1.html tig.1 tigrc.5.html tigrc.5 README.html ifneq (,$(wildcard .git)) VERSION = $(shell git-describe) @@ -25,6 +25,7 @@ install-docs: docs for doc in $(DOCS); do \ case "$$doc" in \ *.1) install $$doc $(PREFIX)/man/man1 ;; \ + *.5) install $$doc $(PREFIX)/man/man5 ;; \ esac \ done @@ -55,3 +56,12 @@ README.html: README %.1 : %.1.xml xmlto man $< + +%.5.html : %.5.txt + asciidoc -b xhtml11 -d manpage $< + +%.5.xml : %.5.txt + asciidoc -b docbook -d manpage $< + +%.5 : %.5.xml + xmlto man $< diff --git a/tig.c b/tig.c index c7a7842..0a2011c 100644 --- a/tig.c +++ b/tig.c @@ -563,54 +563,12 @@ parse_options(int argc, char *argv[]) * FILES * ----- * '~/.tigrc':: - * User configuration file. See "<>" - * section for examples. + * User configuration file. See tigrc(5) for examples. * * '.git/config':: * Repository config file. Read on startup with the help of * git-repo-config(1). **/ -/** - * [[config-options]] - * User Configuration file - * ----------------------- - * You can permanently set an option by putting it in the `~/.tigrc` file. - * The file consists of a series of 'commands'. Each - * line of the file may contain only one command. - * - * The hash mark ('#'), or semi-colon (';') is used as a 'comment' character. - * All text after the comment character to the end of the line is ignored. - * You can use comments to annotate your initialization file. - * - * Some sample options: - * - * ========================================================================== - * # Diff colors - * color diff-header yellow default - * color diff-index blue default - * color diff-chunk magenta default - * # UI colors - * color title-blur white blue - * color title-focus white blue bold - * ========================================================================== - * - * [[color-options]] - * Color options - * ~~~~~~~~~~~~~ - * Color options control highlighting and the user interface styles. - * If your terminal supports color, these commands can be used to assign - * foreground/backgound combinations to certain areas. Optionally, an - * attribute can be given as the last parameter. The syntax is: - * - * [verse] - * .......................................................................... - * *color* 'area' 'fgcolor' 'bgcolor' '[attributes]' - * .......................................................................... - * - * Valid colors include: *white*, *black*, *green*, *magenta*, *blue*, *cyan*, - * *yellow*, *red*, *default*. Use *default* to refer to the default terminal - * colors. - **/ static struct int_map color_map[] = { #define COLOR_MAP(name) { #name, STRING_SIZE(#name), COLOR_##name } @@ -625,11 +583,6 @@ static struct int_map color_map[] = { COLOR_MAP(YELLOW), }; -/** - * Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*, *standout*, - * and *underline*. Note, not all attributes may be supported by the terminal. - **/ - static struct int_map attr_map[] = { #define ATTR_MAP(name) { #name, STRING_SIZE(#name), A_##name } ATTR_MAP(NORMAL), @@ -641,35 +594,11 @@ static struct int_map attr_map[] = { ATTR_MAP(UNDERLINE), }; -/** - * Valid area names are described below. Note, all names are case-insensitive, - * and you may use '-', '_', and '.' interchangeably. So "Diff-Header", - * "DIFF_HEADER", and "diff.header" are the same. - * - * -- - **/ #define LINE_INFO \ -/** - * Diff markup:: - * - * Options concerning diff start, chunks and lines added and deleted. - * - * *diff-header*, *diff-chunk*, *diff-add*, *diff-del* - **/ \ LINE(DIFF_HEADER, "diff --git ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(DIFF_CHUNK, "@@", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ LINE(DIFF_ADD, "+", COLOR_GREEN, COLOR_DEFAULT, 0), \ LINE(DIFF_DEL, "-", COLOR_RED, COLOR_DEFAULT, 0), \ -/** - * Enhanced git diff markup:: - * - * Extra diff information emitted by the git diff machinery, such as mode - * changes, rename detection, and similarity. - * - * *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*, - * *diff-rename-from*, *diff-rename-to*, *diff-similarity* *diff-dissimilarity* - * *diff-tree*, *diff-index* - **/ \ LINE(DIFF_INDEX, "index ", COLOR_BLUE, COLOR_DEFAULT, 0), \ LINE(DIFF_OLDMODE, "old file mode ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(DIFF_NEWMODE, "new file mode ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ @@ -680,56 +609,18 @@ LINE(DIFF_RENAME_TO, "rename to", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(DIFF_SIMILARITY, "similarity ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(DIFF_DISSIMILARITY,"dissimilarity ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(DIFF_TREE, "diff-tree ", COLOR_BLUE, COLOR_DEFAULT, 0), \ -/** - * Pretty print commit headers:: - * - * Commit diffs and the revision logs are usually formatted using pretty - * printed headers , unless `--pretty=raw` was given. This includes lines, - * such as merge info, commit ID, and author and comitter date. - * - * *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate* - **/ \ LINE(PP_AUTHOR, "Author: ", COLOR_CYAN, COLOR_DEFAULT, 0), \ LINE(PP_COMMIT, "Commit: ", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ LINE(PP_MERGE, "Merge: ", COLOR_BLUE, COLOR_DEFAULT, 0), \ LINE(PP_DATE, "Date: ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(PP_ADATE, "AuthorDate: ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(PP_CDATE, "CommitDate: ", COLOR_YELLOW, COLOR_DEFAULT, 0), \ -/** - * Raw commit header:: - * - * Usually shown when `--pretty=raw` is given, however 'commit' is pretty - * much omnipresent. - * - * *commit*, *parent*, *tree*, *author*, *committer* - **/ \ LINE(COMMIT, "commit ", COLOR_GREEN, COLOR_DEFAULT, 0), \ LINE(PARENT, "parent ", COLOR_BLUE, COLOR_DEFAULT, 0), \ LINE(TREE, "tree ", COLOR_BLUE, COLOR_DEFAULT, 0), \ LINE(AUTHOR, "author ", COLOR_CYAN, COLOR_DEFAULT, 0), \ LINE(COMMITTER, "committer ", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ -/** - * Commit message:: - * - * For now only `Signed-off-by lines` are colorized. - * - * *signoff* - **/ \ LINE(SIGNOFF, " Signed-off-by", COLOR_YELLOW, COLOR_DEFAULT, 0), \ -/** - * UI colors:: - * - * Colors for text not matching any of the above: *default* - * - * Status window colors: *status* - * - * Title window colors: *title-blur*, *title-focus* - * - * Cursor line colors: *cursor* - * - * Main view specific: *main-date*, *main-author*, *main-commit*, *main-delim*, - * *main-tag*, *main-ref* - **/ \ LINE(DEFAULT, "", COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), \ LINE(CURSOR, "", COLOR_WHITE, COLOR_GREEN, A_BOLD), \ LINE(STATUS, "", COLOR_GREEN, COLOR_DEFAULT, 0), \ @@ -741,9 +632,6 @@ LINE(MAIN_COMMIT, "", COLOR_DEFAULT, COLOR_DEFAULT, 0), \ LINE(MAIN_DELIM, "", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ LINE(MAIN_TAG, "", COLOR_MAGENTA, COLOR_DEFAULT, A_BOLD), \ LINE(MAIN_REF, "", COLOR_CYAN, COLOR_DEFAULT, A_BOLD), \ -/** - * -- - **/ /* diff --git a/tigrc.5.txt b/tigrc.5.txt new file mode 100644 index 0000000..522dad4 --- /dev/null +++ b/tigrc.5.txt @@ -0,0 +1,122 @@ +tigrc(5) +======== + +NAME +---- +tigrc - tig user configuration file + +SYNOPSIS +-------- +[verse] +............................................................................. +*color* 'fgcolor' 'bgcolor' '[attributes]' +............................................................................. + +DESCRIPTION +----------- +You can permanently set an option by putting it in the `~/.tigrc` file. +The file consists of a series of 'commands'. Each +line of the file may contain only one command. + +The hash mark ('#'), or semi-colon (';') is used as a 'comment' character. +All text after the comment character to the end of the line is ignored. +You can use comments to annotate your initialization file. + +Color options +------------- + +Color options control highlighting and the user interface styles. +If your terminal supports color, these commands can be used to assign +foreground/backgound combinations to certain areas. Optionally, an +attribute can be given as the last parameter. The syntax is: + +[verse] +.......................................................................... + *color* 'area' 'fgcolor' 'bgcolor' '[attributes]' +.......................................................................... + +Valid colors include: *white*, *black*, *green*, *magenta*, *blue*, *cyan*, +*yellow*, *red*, *default*. Use *default* to refer to the default terminal +colors. + +Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*, *standout*, +and *underline*. Note, not all attributes may be supported by the terminal. + +Valid area names are described below. Note, all names are case-insensitive, +and you may use '-', '_', and '.' interchangeably. So "Diff-Header", +"DIFF_HEADER", and "diff.header" are the same. + +Diff markup +~~~~~~~~~~~ + +Options concerning diff start, chunks and lines added and deleted. + +*diff-header*, *diff-chunk*, *diff-add*, *diff-del* + +Enhanced git diff markup +~~~~~~~~~~~~~~~~~~~~~~~~ + +Extra diff information emitted by the git diff machinery, such as mode +changes, rename detection, and similarity. + +*diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*, +*diff-rename-from*, *diff-rename-to*, *diff-similarity* *diff-dissimilarity* +*diff-tree*, *diff-index* + +Pretty print commit headers +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Commit diffs and the revision logs are usually formatted using pretty +printed headers , unless `--pretty=raw` was given. This includes lines, +such as merge info, commit ID, and author and comitter date. + +*pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate* + +Raw commit header +~~~~~~~~~~~~~~~~~ + +Usually shown when `--pretty=raw` is given, however 'commit' is pretty +much omnipresent. + +*commit*, *parent*, *tree*, *author*, *committer* + +Commit message +~~~~~~~~~~~~~~ + +For now only `Signed-off-by lines` are colorized. + +*signoff* + +UI colors +~~~~~~~~~ + +Colors for text not matching any of the above: *default* + +Status window colors: *status* + +Title window colors: *title-blur*, *title-focus* + +Cursor line colors: *cursor* + +Main view specific: *main-date*, *main-author*, *main-commit*, *main-delim*, +*main-tag*, *main-ref* + + +EXAMPLES +-------- + +Some sample options: + +========================================================================== + # Diff colors + color diff-header yellow default + color diff-index blue default + color diff-chunk magenta default + # UI colors + color title-blur white blue + color title-focus white blue bold +========================================================================== + +SEE ALSO +-------- +tig(1) -- 2.11.0