diff options
author | René Scharfe <l.s.r@web.de> | 2021-02-14 11:10:57 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-17 18:54:33 +0100 |
commit | b081547ec1de57162f2c1c7748aa09c861413d34 (patch) | |
tree | d6fe0220ce4c6b34e6550650891c9b412890fdce /t/t4205-log-pretty-formats.sh | |
parent | pretty: add %(describe) (diff) | |
download | git-b081547ec1de57162f2c1c7748aa09c861413d34.tar.xz git-b081547ec1de57162f2c1c7748aa09c861413d34.zip |
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-x | t/t4205-log-pretty-formats.sh | 16 |
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 |