diff --git a/doc/manual.adoc b/doc/manual.adoc index cf87ba185..fc1d8c1aa 100644 --- a/doc/manual.adoc +++ b/doc/manual.adoc @@ -264,6 +264,9 @@ TIGRC_USER:: TIGRC_SYSTEM:: Path of the system wide configuration file. +TIGRC_EXTRA:: + Path of the additional configuration file. + [[history-files]] History Files ~~~~~~~~~~~~~ diff --git a/doc/tig.1.adoc b/doc/tig.1.adoc index 30b60e31b..e0919dae5 100644 --- a/doc/tig.1.adoc +++ b/doc/tig.1.adoc @@ -206,6 +206,9 @@ TIGRC_SYSTEM:: `{sysconfdir}/tigrc`). Define to empty string to use built-in configuration. +TIGRC_EXTRA:: + Path of the additional configuration file. + TIG_LS_REMOTE:: Command for retrieving all repository references. The command should output data in the same format as git-ls-remote(1). diff --git a/src/options.c b/src/options.c index cb1177a8d..352af67a2 100644 --- a/src/options.c +++ b/src/options.c @@ -1013,6 +1013,7 @@ enum status_code load_options(void) { const char *tigrc_user = getenv("TIGRC_USER"); + const char *tigrc_extra = getenv("TIGRC_EXTRA"); const char *tigrc_system = getenv("TIGRC_SYSTEM"); const char *tig_diff_opts = getenv("TIG_DIFF_OPTS"); const bool diff_opts_from_args = !!opt_diff_options; @@ -1053,6 +1054,10 @@ load_options(void) load_option_file(TIG_USER_CONFIG); } + if (tigrc_extra) { + load_option_file(tigrc_extra); + } + if (!diff_opts_from_args && tig_diff_opts && *tig_diff_opts) { static const char *diff_opts[SIZEOF_ARG] = { NULL }; char buf[SIZEOF_STR];