summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-16 19:18:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-16 19:18:41 (GMT)
commit3009afd54ecbac1b7cd556085cd2d32f3d6772d3 (patch)
treea1ce7a12c870ed3b0c38f0475782db4289af5452 /builtin/log.c
parent668668ad5064c66d4040cfef5814ec1353c2e3d1 (diff)
parent1571586648da4e2d759bce1146d5585c91aca8d6 (diff)
downloadgit-3009afd54ecbac1b7cd556085cd2d32f3d6772d3.zip
git-3009afd54ecbac1b7cd556085cd2d32f3d6772d3.tar.gz
git-3009afd54ecbac1b7cd556085cd2d32f3d6772d3.tar.bz2
Merge branch 'lt/log-auto-decorate'
* lt/log-auto-decorate: git log: support "auto" decorations
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 83b6c48..a7ba211 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -63,6 +63,8 @@ static int parse_decoration_style(const char *var, const char *value)
return DECORATE_FULL_REFS;
else if (!strcmp(value, "short"))
return DECORATE_SHORT_REFS;
+ else if (!strcmp(value, "auto"))
+ return (isatty(1) || pager_in_use()) ? DECORATE_SHORT_REFS : 0;
return -1;
}