Code

Remove support for the deprecated TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD env vars
authorJonas Fonseca <fonseca@diku.dk>
Sat, 12 Jun 2010 16:37:44 +0000 (12:37 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 10 Mar 2011 02:44:42 +0000 (21:44 -0500)
NEWS
tig.c

diff --git a/NEWS b/NEWS
index 6091738f29cdf2c42670af958e1b5c42d034141e..02ec3ef6558a638fff6ee2974796d4407455f395 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ Release notes
 master
 ------
 
+Incompatibilities:
+
+ - Remove support for the deprecated TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD
+   environment variables.
+
 Improvements:
 
  - (GH-6) Make blame configurable via extra options passed from the command
diff --git a/tig.c b/tig.c
index f56547455c50dcf170dbdb0f8424915a9db2c40e..9745f2c3dca5ffe9a3a0af4193aba4cd86fd5c05 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1378,7 +1378,6 @@ enum view_type {
 struct view {
        enum view_type type;    /* View type */
        const char *name;       /* View name */
-       const char *cmd_env;    /* Command line set via environment */
        const char *id;         /* Points to either of ref_{head,commit,blob} */
 
        struct view_ops *ops;   /* View operations */
@@ -1463,11 +1462,11 @@ static struct view_ops status_ops;
 static struct view_ops tree_ops;
 static struct view_ops branch_ops;
 
-#define VIEW_STR(type, name, env, ref, ops, map, git) \
-       { type, name, #env, ref, ops, map, git }
+#define VIEW_STR(type, name, ref, ops, map, git) \
+       { type, name, ref, ops, map, git }
 
 #define VIEW_(id, name, ops, git, ref) \
-       VIEW_STR(VIEW_##id, name, TIG_##id##_CMD, ref, ops, KEYMAP_##id, git)
+       VIEW_STR(VIEW_##id, name, ref, ops, KEYMAP_##id, git)
 
 static struct view views[] = {
        VIEW_(MAIN,   "main",   &main_ops,   TRUE,  ref_head),
@@ -6874,7 +6873,6 @@ main(int argc, const char *argv[])
        const char *codeset = "UTF-8";
        enum request request = parse_options(argc, argv);
        struct view *view;
-       size_t i;
 
        signal(SIGINT, quit);
        signal(SIGPIPE, SIG_IGN);
@@ -6911,16 +6909,6 @@ main(int argc, const char *argv[])
        if (load_refs() == ERR)
                die("Failed to load refs.");
 
-       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();
 
        while (view_driver(display[current_view], request)) {