Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-02-14 13:10:57 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-17 20:54:33 +0300
commitb081547ec1de57162f2c1c7748aa09c861413d34 (patch)
treed6fe0220ce4c6b34e6550650891c9b412890fdce /t/t4205-log-pretty-formats.sh
parent15ae82d5d6ccdcad00aeb456ff512d3031f03039 (diff)
pretty: add merge and exclude options to %(describe)
Allow restricting the tags used by the placeholder %(describe) with the options match and exclude. E.g. the following command describes the current commit using official version tags, without those for release candidates: $ git log -1 --format='%(describe:match=v[0-9]*,exclude=*rc*)' Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4205-log-pretty-formats.sh')
-rwxr-xr-xt/t4205-log-pretty-formats.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 5a44fa447d..7e36706212 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -972,4 +972,20 @@ test_expect_success '%(describe) vs git describe' '
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