From 1d517ceab98fd5c3c1a8fb6ef575b44c31ea7a9e Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 31 Oct 2021 13:15:09 -0400 Subject: pretty: add tag option to %(describe) The %(describe) placeholder by default, like `git describe`, only supports annotated tags. However, some people do use lightweight tags for releases, and would like to describe those anyway. The command line tool has an option to support this. Teach the placeholder to support this as well. Signed-off-by: Eli Schwartz Signed-off-by: Junio C Hamano --- t/t4205-log-pretty-formats.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't/t4205-log-pretty-formats.sh') diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index 5865daa8f8..d4acf8882f 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -1002,4 +1002,12 @@ test_expect_success '%(describe:exclude=...) vs git describe --exclude ...' ' test_cmp expect actual ' +test_expect_success '%(describe:tags) vs git describe --tags' ' + test_when_finished "git tag -d tagname" && + git tag tagname && + git describe --tags >expect && + git log -1 --format="%(describe:tags)" >actual && + test_cmp expect actual +' + test_done -- cgit v1.2.3