summaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorSteven Drake <sdrake@xnet.co.nz>2010-02-17 12:39:52 +1300
committerJunio C Hamano <gitster@pobox.com>2010-02-17 09:51:23 -0800
commiteb734454098fb68af1fb0e157dd5e67bb15a602d (patch)
treebee4d04089a6c03405c2a02e02680c29e76ffd33 /builtin-log.c
parent8420ccd8b884e1edceca9ea5824f3ff300c0c4ba (diff)
Add `log.decorate' configuration variable.
This alows the 'git-log --decorate' to be enabled by default so that normal log outout contains ant ref names of commits that are shown. Signed-off-by: Steven Drake <sdrake@xnet.co.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 8d16832f7e..3100dc00a8 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -24,6 +24,7 @@
static const char *default_date_mode = NULL;
static int default_show_root = 1;
+static int decoration_style = 0;
static const char *fmt_patch_subject_prefix = "PATCH";
static const char *fmt_pretty;
@@ -35,7 +36,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
struct rev_info *rev)
{
int i;
- int decoration_style = 0;
rev->abbrev = DEFAULT_ABBREV;
rev->commit_format = CMIT_FMT_DEFAULT;
@@ -252,6 +252,13 @@ static int git_log_config(const char *var, const char *value, void *cb)
return git_config_string(&fmt_patch_subject_prefix, var, value);
if (!strcmp(var, "log.date"))
return git_config_string(&default_date_mode, var, value);
+ if (!strcmp(var, "log.decorate")) {
+ if (!strcmp(value, "full"))
+ decoration_style = DECORATE_FULL_REFS;
+ else if (!strcmp(value, "short"))
+ decoration_style = DECORATE_SHORT_REFS;
+ return 0;
+ }
if (!strcmp(var, "log.showroot")) {
default_show_root = git_config_bool(var, value);
return 0;