From 96e58f5bdc9c8c7ab3c3f07087a13c3959dcb2bd Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 20 Aug 2007 23:03:21 +0200 Subject: [PATCH] autoconf: check whether to use git-config or git-repo-config --- TODO | 3 --- configure.ac | 2 ++ tig.c | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 9ff2b32..8e18e60 100644 --- a/TODO +++ b/TODO @@ -24,8 +24,5 @@ Features that should be explored. - Use autoconf to check for the AsciiDoc and XmlTo document tools. - - The autoconf check could also be used to determine whether it is a - newer git so that git-config will be used instead of git-repo-config. - - Use non-blocking I/O + select() for incremental loading of view input. (debian bug #427093) diff --git a/configure.ac b/configure.ac index 0e06af5..0c060ce 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,8 @@ then fi AC_PROG_CC +AC_CHECK_PROGS(GIT_CONFIG, [git-config git-repo-config]) +AC_DEFINE_UNQUOTED(GIT_CONFIG,"$GIT_CONFIG",[git config program]) AC_CONFIG_FILES([config.make]) AC_OUTPUT diff --git a/tig.c b/tig.c index 1ad9264..21dd6c2 100644 --- a/tig.c +++ b/tig.c @@ -92,6 +92,10 @@ static size_t utf8_length(const char *string, size_t max_width, int *coloffset, #define SCALE_SPLIT_VIEW(height) ((height) * 2 / 3) +#ifndef GIT_CONFIG +#define "git config" +#endif + #define TIG_LS_REMOTE \ "git ls-remote $(git rev-parse --git-dir) 2>/dev/null" @@ -4304,7 +4308,7 @@ read_repo_config_option(char *name, size_t namelen, char *value, size_t valuelen static int load_repo_config(void) { - return read_properties(popen("git repo-config --list", "r"), + return read_properties(popen(GIT_CONFIG " --list", "r"), "=", read_repo_config_option); } -- 2.30.2