Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TIGRC_EXTRA #970

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~
Expand Down
3 changes: 3 additions & 0 deletions doc/tig.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
5 changes: 5 additions & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down