X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/69efc854376705ad0f0cda4994b015eea5ec2820..c692b4e4a2fcddbde05187d2d37c228f91d36274:/tig.c diff --git a/tig.c b/tig.c index 49848d6..21dd6c2 100644 --- a/tig.c +++ b/tig.c @@ -11,8 +11,8 @@ * GNU General Public License for more details. */ -#ifndef VERSION -#define VERSION "unknown-version" +#ifndef TIG_VERSION +#define TIG_VERSION "unknown-version" #endif #ifndef DEBUG @@ -40,6 +40,8 @@ #include +#include "config.h" + #if __GNUC__ >= 3 #define __NORETURN __attribute__((__noreturn__)) #else @@ -90,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" @@ -390,7 +396,7 @@ get_request(const char *name) */ static const char usage[] = -"tig " VERSION " (" __DATE__ ")\n" +"tig " TIG_VERSION " (" __DATE__ ")\n" "\n" "Usage: tig [options]\n" " or: tig [options] [--] [git log options]\n" @@ -516,7 +522,7 @@ parse_options(int argc, char *argv[]) } if (check_option(opt, 'v', "version", OPT_NONE)) { - printf("tig version %s\n", VERSION); + printf("tig version %s\n", TIG_VERSION); return FALSE; } @@ -1926,7 +1932,7 @@ update_view(struct view *view) line[linelen - 1] = 0; if (opt_iconv != ICONV_NONE) { - char *inbuf = line; + ICONV_INBUF_TYPE inbuf = line; size_t inlen = linelen; char *outbuf = out_buffer; @@ -2286,7 +2292,7 @@ view_driver(struct view *view, enum request request) break; case REQ_SHOW_VERSION: - report("tig-%s (built %s)", VERSION, __DATE__); + report("tig-%s (built %s)", TIG_VERSION, __DATE__); return TRUE; case REQ_SCREEN_RESIZE: @@ -4302,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); }