From b00784cc39b2d7b6069d382a2405fb3e117386d1 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 5 Jun 2010 00:23:09 -0400 Subject: [PATCH] Deprecate use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables --- NEWS | 3 +++ manual.txt | 67 +++++------------------------------------------------- tig.1.txt | 27 ++++------------------ tig.c | 7 +++++- 4 files changed, 19 insertions(+), 85 deletions(-) diff --git a/NEWS b/NEWS index 50f555c..190e5dc 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ Incompatibilities: but should in general improve handling of character lengths etc. Also, to properly handle UTF-8 environments use ncurses with wide character support. + - The use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables + has been deprecated. To allow configuration of the diff view, + TIG_DIFF_OPTS can be used. Improvements: diff --git a/manual.txt b/manual.txt index b8536da..acfe9fd 100644 --- a/manual.txt +++ b/manual.txt @@ -238,74 +238,19 @@ git ls-remote . -- -[[history-commands]] -History Commands -~~~~~~~~~~~~~~~~ +[[diff-options]] +Diff options +~~~~~~~~~~~~ -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: +It is possible to alter how diffs are shown by the diff view. If for example +you prefer to have commit and author dates shown as relative dates, use: ----------------------------------------------------------------------------- -$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %(head)" tig +$ TIG_DIFF_OPTS="--relative-date" tig ----------------------------------------------------------------------------- Or set the variable permanently in your environment. -Notice, how `%(head)` is used to specify the commit reference. - --- - -TIG_DIFF_CMD:: - - The command used for the diff view. Defaults to: ------------------------------------------------------------------------------ -git show --pretty=fuller --no-color --root - --patch-with-stat --find-copies-harder -C %(commit) ------------------------------------------------------------------------------ - -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. Defaults to: ------------------------------------------------------------------------------ -git log --no-color --cc --stat -n100 %(head) ------------------------------------------------------------------------------ - -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. ------------------------------------------------------------------------------ -git log --no-color --pretty=raw --parents --topo-order %(head) ------------------------------------------------------------------------------ - --- - -[[tree-commands]] -Tree Commands -~~~~~~~~~~~~~ - --- - -TIG_TREE_CMD:: - - The command used for the tree view. Defaults to: ------------------------------------------------------------------------------ -git ls-tree %(commit) %(directory) ------------------------------------------------------------------------------ - -TIG_BLOB_CMD:: - - The command used for the blob view. Defaults to: ------------------------------------------------------------------------------ -git cat-file blob %(blob) ------------------------------------------------------------------------------ - --- - [[keys]] Default Keybindings ------------------- diff --git a/tig.1.txt b/tig.1.txt index 30acf7c..3e2ffdf 100644 --- a/tig.1.txt +++ b/tig.1.txt @@ -109,29 +109,10 @@ 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. - -Tree commands -~~~~~~~~~~~~~ -TIG_TREE_CMD:: - The command used for the tree view. By default, git-ls-tree(1) is - used. - -TIG_BLOB_CMD:: - The command used for the blob view. By default, git-cat-file(1) is - used. +TIG_DIFF_OPTS:: + The diff options to use in the diff view. The diff view uses + git-show(1) for formatting and always passes --patch-with-stat, + --find-copies-harder, and -C. FILES ----- diff --git a/tig.c b/tig.c index a2fe255..01f48c3 100644 --- a/tig.c +++ b/tig.c @@ -7859,10 +7859,15 @@ main(int argc, const char *argv[]) if (load_refs() == ERR) die("Failed to load refs."); - foreach_view (view, i) + foreach_view (view, i) { + if (getenv(view->cmd_env)) + warn("Use of the %s environment variable is deprecated," + " use options or TIG_DIFF_ARGS instead", + view->cmd_env); if (!argv_from_env(view->ops->argv, view->cmd_env)) die("Too many arguments in the `%s` environment variable", view->cmd_env); + } init_display(); -- 2.30.2