summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-13 21:28:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-13 21:28:54 (GMT)
commit6c3daa23461333c508c41faa532c6fb749cd0db0 (patch)
tree0d480e7fae2e4d975e317b22f99d668bac436fbe /t
parent721cc4314cb593e799213ad5f926a1e9fc5779b0 (diff)
parent65516f586b69307f977cd67cc45513a296cabc25 (diff)
downloadgit-6c3daa23461333c508c41faa532c6fb749cd0db0.zip
git-6c3daa23461333c508c41faa532c6fb749cd0db0.tar.gz
git-6c3daa23461333c508c41faa532c6fb749cd0db0.tar.bz2
Merge branch 'ra/decorate-limit-refs'
The tagnames "git log --decorate" uses to annotate the commits can now be limited to subset of available refs with the two additional options, --decorate-refs[-exclude]=<pattern>. * ra/decorate-limit-refs: log: add option to choose which refs to decorate
Diffstat (limited to 't')
-rwxr-xr-xt/t4202-log.sh101
1 files changed, 101 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 8f155da..25b1f8c 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -737,6 +737,107 @@ test_expect_success 'log.decorate configuration' '
'
+test_expect_success 'decorate-refs with glob' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
+ seventh
+ octopus-b (octopus-b)
+ octopus-a (octopus-a)
+ reach
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs="heads/octopus*" >actual &&
+ test_cmp expect.decorate actual
+'
+
+test_expect_success 'decorate-refs without globs' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
+ seventh
+ octopus-b
+ octopus-a
+ reach (tag: reach)
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs="tags/reach" >actual &&
+ test_cmp expect.decorate actual
+'
+
+test_expect_success 'multiple decorate-refs' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
+ seventh
+ octopus-b (octopus-b)
+ octopus-a (octopus-a)
+ reach (tag: reach)
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs="heads/octopus*" \
+ --decorate-refs="tags/reach" >actual &&
+ test_cmp expect.decorate actual
+'
+
+test_expect_success 'decorate-refs-exclude with glob' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach (HEAD -> master)
+ Merge-tags-octopus-a-and-octopus-b
+ seventh (tag: seventh)
+ octopus-b (tag: octopus-b)
+ octopus-a (tag: octopus-a)
+ reach (tag: reach, reach)
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs-exclude="heads/octopus*" >actual &&
+ test_cmp expect.decorate actual
+'
+
+test_expect_success 'decorate-refs-exclude without globs' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach (HEAD -> master)
+ Merge-tags-octopus-a-and-octopus-b
+ seventh (tag: seventh)
+ octopus-b (tag: octopus-b, octopus-b)
+ octopus-a (tag: octopus-a, octopus-a)
+ reach (reach)
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs-exclude="tags/reach" >actual &&
+ test_cmp expect.decorate actual
+'
+
+test_expect_success 'multiple decorate-refs-exclude' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach (HEAD -> master)
+ Merge-tags-octopus-a-and-octopus-b
+ seventh (tag: seventh)
+ octopus-b (tag: octopus-b)
+ octopus-a (tag: octopus-a)
+ reach (reach)
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs-exclude="heads/octopus*" \
+ --decorate-refs-exclude="tags/reach" >actual &&
+ test_cmp expect.decorate actual
+'
+
+test_expect_success 'decorate-refs and decorate-refs-exclude' '
+ cat >expect.decorate <<-\EOF &&
+ Merge-tag-reach (master)
+ Merge-tags-octopus-a-and-octopus-b
+ seventh
+ octopus-b
+ octopus-a
+ reach (reach)
+ EOF
+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
+ --decorate-refs="heads/*" \
+ --decorate-refs-exclude="heads/oc*" >actual &&
+ test_cmp expect.decorate actual
+'
+
test_expect_success 'log.decorate config parsing' '
git log --oneline --decorate=full >expect.full &&
git log --oneline --decorate=short >expect.short &&