summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-17 10:20:49 -0800
committerJunio C Hamano <gitster@pobox.com>2010-02-17 10:20:49 -0800
commit8a3d203bd02bec48a02557961899d81da172fa23 (patch)
tree8d85296b6d6dda98eb01cb17198ecb06d25a8eed /t/t4202-log.sh
parenteb734454098fb68af1fb0e157dd5e67bb15a602d (diff)
downloadgit-8a3d203bd02bec48a02557961899d81da172fa23.tar.gz
log.decorate: usability fixes
The configuration is meant to suppliment --decorate command line option that can be used as a boolean to turn the feature on, so it is natural to expect [log] decorate decorate = yes to work. The original commit would segfault with the first one, and would not understand the second one. Once a user has this configuration in ~/.gitconfig, there needs to be a way to override it from the command line. Add --no-decorate option to log family and also allow --decorate=no to mean the same thing. Since we allow setting log.decorate to 'true', the command line also should accept --decorate=yes and behave accordingly. New tests in t4202 are designed to exercise the interaction between the configuration variable and the command line option that overrides it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 1dc224f6fb..2230e606ed 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -387,5 +387,54 @@ test_expect_success 'log --graph with merge' '
test_cmp expect actual
'
+test_expect_success 'log.decorate configuration' '
+ git config --unset-all log.decorate || :
+
+ 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 --oneline >actual &&
+ test_cmp expect.short actual &&
+
+ git config --unset-all log.decorate &&
+ git config log.decorate true &&
+ git log --oneline >actual &&
+ test_cmp expect.short actual &&
+ git log --oneline --decorate=full >actual &&
+ test_cmp expect.full actual &&
+ git log --oneline --decorate=no >actual &&
+ test_cmp expect.none actual &&
+
+ git config --unset-all log.decorate &&
+ git config log.decorate no &&
+ git log --oneline >actual &&
+ test_cmp expect.none actual &&
+ git log --oneline --decorate >actual &&
+ test_cmp expect.short actual &&
+ git log --oneline --decorate=full >actual &&
+ test_cmp expect.full actual &&
+
+ git config --unset-all log.decorate &&
+ git config log.decorate short &&
+ git log --oneline >actual &&
+ test_cmp expect.short actual &&
+ git log --oneline --no-decorate >actual &&
+ test_cmp expect.none actual &&
+ git log --oneline --decorate=full >actual &&
+ test_cmp expect.full actual &&
+
+ git config --unset-all log.decorate &&
+ git config log.decorate full &&
+ git log --oneline >actual &&
+ test_cmp expect.full actual &&
+ git log --oneline --no-decorate >actual &&
+ test_cmp expect.none actual &&
+ git log --oneline --decorate >actual &&
+ test_cmp expect.short actual
+
+'
+
test_done