summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-reflog.txt2
-rw-r--r--builtin/log.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt
index ff487ff77..9dccd4bcf 100644
--- a/Documentation/git-reflog.txt
+++ b/Documentation/git-reflog.txt
@@ -41,6 +41,8 @@ command-line (or `HEAD`, by default). The reflog covers all recent
actions, and in addition the `HEAD` reflog records branch switching.
`git reflog show` is an alias for `git log -g --abbrev-commit
--pretty=oneline`; see linkgit:git-log[1] for more information.
+The config option `reflog.pretty` is used as the default pretty
+format if nothing else is specified.
The "expire" subcommand prunes older reflog entries. Entries older
than `expire` time, or entries older than `expire-unreachable` time
diff --git a/builtin/log.c b/builtin/log.c
index a479642eb..0fbd32401 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -667,6 +667,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
{
struct rev_info rev;
struct setup_revision_opt opt;
+ int cfg_have_pretty;
init_log_defaults();
git_config(git_log_config, NULL);
@@ -676,11 +677,16 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
rev.verbose_header = 1;
memset(&opt, 0, sizeof(opt));
opt.def = "HEAD";
+
+ cfg_have_pretty = git_config_get_string_const("reflog.pretty", &fmt_pretty);
cmd_log_init_defaults(&rev);
- rev.abbrev_commit = 1;
- rev.commit_format = CMIT_FMT_ONELINE;
- rev.use_terminator = 1;
+ if (cfg_have_pretty != 0) {
+ rev.abbrev_commit = 1;
+ rev.commit_format = CMIT_FMT_ONELINE;
+ rev.use_terminator = 1;
+ }
rev.always_show_header = 1;
+
cmd_log_init_finish(argc, argv, prefix, &rev, &opt);
return cmd_log_walk(&rev);