]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4205-log-pretty-formats.sh
Merge branch 'en/ort-perf-batch-9'
[thirdparty/git.git] / t / t4205-log-pretty-formats.sh
index 85432b80ff52a7014be3c3912c38163e989adc70..cabdf7d57a00e3110770a911e7893373a3ab2196 100755 (executable)
@@ -962,4 +962,39 @@ test_expect_success 'log --pretty=reference is colored appropriately' '
        test_cmp expect actual
 '
 
+test_expect_success '%(describe) vs git describe' '
+       git log --format="%H" | while read hash
+       do
+               if desc=$(git describe $hash)
+               then
+                       : >expect-contains-good
+               else
+                       : >expect-contains-bad
+               fi &&
+               echo "$hash $desc"
+       done >expect &&
+       test_path_exists expect-contains-good &&
+       test_path_exists expect-contains-bad &&
+
+       git log --format="%H %(describe)" >actual 2>err &&
+       test_cmp expect actual &&
+       test_must_be_empty err
+'
+
+test_expect_success '%(describe:match=...) vs git describe --match ...' '
+       test_when_finished "git tag -d tag-match" &&
+       git tag -a -m tagged tag-match&&
+       git describe --match "*-match" >expect &&
+       git log -1 --format="%(describe:match=*-match)" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success '%(describe:exclude=...) vs git describe --exclude ...' '
+       test_when_finished "git tag -d tag-exclude" &&
+       git tag -a -m tagged tag-exclude &&
+       git describe --exclude "*-exclude" >expect &&
+       git log -1 --format="%(describe:exclude=*-exclude)" >actual &&
+       test_cmp expect actual
+'
+
 test_done