Skip to content

Commit

Permalink
Add `log.decorate' configuration variable.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Drake authored and Junio C Hamano committed Feb 17, 2010
1 parent 8420ccd commit eb73445
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,13 @@ log.date::
following alternatives: {relative,local,default,iso,rfc,short}.
See linkgit:git-log[1].

log.decorate::
Print out the ref names of any commits that are shown by the log
command. If 'short' is specified, the ref name prefixes 'refs/heads/',
'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is
specified, the full ref name (including prefix) will be printed.
This is the same as the log commands '--decorate' option.

log.showroot::
If true, the initial commit will be shown as a big creation event.
This is equivalent to a diff against an empty tree.
Expand Down
9 changes: 8 additions & 1 deletion builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit eb73445

Please sign in to comment.