* GNU General Public License for more details.
*/
-#ifndef VERSION
-#define VERSION "unknown-version"
+#ifndef TIG_VERSION
+#define TIG_VERSION "unknown-version"
#endif
#ifndef DEBUG
#include <curses.h>
+#include "config.h"
+
#if __GNUC__ >= 3
#define __NORETURN __attribute__((__noreturn__))
#else
#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"
*/
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"
}
if (check_option(opt, 'v', "version", OPT_NONE)) {
- printf("tig version %s\n", VERSION);
+ printf("tig version %s\n", TIG_VERSION);
return FALSE;
}
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;
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:
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);
}