summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b0e621a)
raw | patch | inline | side by side (parent: b0e621a)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 8 Apr 2010 17:17:17 +0000 (10:17 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 9 Apr 2010 06:13:48 +0000 (23:13 -0700) |
Unlike notes that are often multi-line and disrupting to be placed in many
output formats, a decoration is designed to be a small token that can be
tacked after an existing line of the output where a commit object name sits.
Disabling log.decorate for something like "log --oneline" would defeat the
purpose of the configuration.
We _might_ want to change it further in the future to force scripts that
do not want to be broken by random end user configurations to explicitly
say "log --no-decorate", but that would be an incompatible change that
needs the usual multi-release-cycle deprecation process.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
output formats, a decoration is designed to be a small token that can be
tacked after an existing line of the output where a commit object name sits.
Disabling log.decorate for something like "log --oneline" would defeat the
purpose of the configuration.
We _might_ want to change it further in the future to force scripts that
do not want to be broken by random end user configurations to explicitly
say "log --no-decorate", but that would be an incompatible change that
needs the usual multi-release-cycle deprecation process.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-log.c | patch | blob | history | |
t/t4202-log.sh | patch | blob | history |
diff --git a/builtin-log.c b/builtin-log.c
index 7f4186f19e241ce28ae57f49f3b64da731fab74a..017fcf82ce3705335e5548b193e4d590e4949c62 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
}
/*
- * defeat log.decorate configuration interacting with --pretty
+ * defeat log.decorate configuration interacting with --pretty=raw
* from the command line.
*/
- if (!decoration_given && rev->pretty_given)
+ if (!decoration_given && rev->pretty_given
+ && rev->commit_format == CMIT_FMT_RAW)
decoration_style = 0;
if (decoration_style) {
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 166de4479c1e704990886003f3602aaa5e13e985..2230e606edea0c4f3dcd0b6b99298074d5341e4a 100755 (executable)
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
test_expect_success 'log.decorate configuration' '
git config --unset-all log.decorate || :
- git log >expect.none &&
- git log --decorate >expect.short &&
- git log --decorate=full >expect.full &&
- git log --oneline >expect.oneline &&
+ git log --oneline >expect.none &&
+ git log --oneline --decorate >expect.short &&
+ git log --oneline --decorate=full >expect.full &&
echo "[log] decorate" >>.git/config &&
- git log >actual &&
- test_cmp expect.short actual &&
git log --oneline >actual &&
- test_cmp expect.oneline actual &&
+ test_cmp expect.short actual &&
git config --unset-all log.decorate &&
git config log.decorate true &&
- git log >actual &&
+ git log --oneline >actual &&
test_cmp expect.short actual &&
- git log --decorate=full >actual &&
+ git log --oneline --decorate=full >actual &&
test_cmp expect.full actual &&
- git log --decorate=no >actual &&
+ git log --oneline --decorate=no >actual &&
test_cmp expect.none actual &&
- git log --oneline >actual &&
- test_cmp expect.oneline actual &&
git config --unset-all log.decorate &&
git config log.decorate no &&
- git log >actual &&
+ git log --oneline >actual &&
test_cmp expect.none actual &&
- git log --decorate >actual &&
+ git log --oneline --decorate >actual &&
test_cmp expect.short actual &&
- git log --decorate=full >actual &&
+ git log --oneline --decorate=full >actual &&
test_cmp expect.full actual &&
- git log --oneline >actual &&
- test_cmp expect.oneline actual &&
git config --unset-all log.decorate &&
git config log.decorate short &&
- git log >actual &&
+ git log --oneline >actual &&
test_cmp expect.short actual &&
- git log --no-decorate >actual &&
+ git log --oneline --no-decorate >actual &&
test_cmp expect.none actual &&
- git log --decorate=full >actual &&
+ git log --oneline --decorate=full >actual &&
test_cmp expect.full actual &&
- git log --oneline >actual &&
- test_cmp expect.oneline actual &&
git config --unset-all log.decorate &&
git config log.decorate full &&
- git log >actual &&
+ git log --oneline >actual &&
test_cmp expect.full actual &&
- git log --no-decorate >actual &&
+ git log --oneline --no-decorate >actual &&
test_cmp expect.none actual &&
- git log --decorate >actual &&
+ git log --oneline --decorate >actual &&
test_cmp expect.short actual
- git log --oneline >actual &&
- test_cmp expect.oneline actual &&
- :
'
test_done