@matheusbsbs / matheus-bagliano / commits / eb73445409
Fork 0

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>

Steven Drake committed Feb 17, 2010 at 12:39 UTC eb734454098fb68af1fb0e157dd5e67bb15a602d
2 files changed +15 -1
Documentation/config.txt
+7
@@ -1232,6 +1232,13 @@ log.date::
1232 following alternatives: {relative,local,default,iso,rfc,short}.
1233 See linkgit:git-log[1].
1234
1235 +log.decorate::
1236 + Print out the ref names of any commits that are shown by the log
1237 + command. If 'short' is specified, the ref name prefixes 'refs/heads/',
1238 + 'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is
1239 + specified, the full ref name (including prefix) will be printed.
1240 + This is the same as the log commands '--decorate' option.
1241 +
1242 log.showroot::
1243 If true, the initial commit will be shown as a big creation event.
1244 This is equivalent to a diff against an empty tree.
builtin-log.c
+8 -1
@@ -24,6 +24,7 @@
24 static const char *default_date_mode = NULL;
25
26 static int default_show_root = 1;
27 +static int decoration_style = 0;
28 static const char *fmt_patch_subject_prefix = "PATCH";
29 static const char *fmt_pretty;
30
@@ -35,7 +36,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
36 struct rev_info *rev)
37 {
38 int i;
38 - int decoration_style = 0;
39
40 rev->abbrev = DEFAULT_ABBREV;
41 rev->commit_format = CMIT_FMT_DEFAULT;
@@ -252,6 +252,13 @@ static int git_log_config(const char *var, const char *value, void *cb)
252 return git_config_string(&fmt_patch_subject_prefix, var, value);
253 if (!strcmp(var, "log.date"))
254 return git_config_string(&default_date_mode, var, value);
255 + if (!strcmp(var, "log.decorate")) {
256 + if (!strcmp(value, "full"))
257 + decoration_style = DECORATE_FULL_REFS;
258 + else if (!strcmp(value, "short"))
259 + decoration_style = DECORATE_SHORT_REFS;
260 + return 0;
261 + }
262 if (!strcmp(var, "log.showroot")) {
263 default_show_root = git_config_bool(var, value);
264 return 0;