diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-03-22 22:00:24 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-22 22:00:24 +0100 |
commit | 25f9326561292b45311c60879d9bc08618727973 (patch) | |
tree | d6ea2102ed47d0464154fa78c523a303c3fb3cef /t/t4205-log-pretty-formats.sh | |
parent | Merge branch 'dl/stash-show-untracked' (diff) | |
parent | archive: expand only a single %(describe) per archive (diff) | |
download | git-25f9326561292b45311c60879d9bc08618727973.tar.xz git-25f9326561292b45311c60879d9bc08618727973.zip |
Merge branch 'rs/pretty-describe'
"git log --format='...'" learned "%(describe)" placeholder.
* rs/pretty-describe:
archive: expand only a single %(describe) per archive
pretty: document multiple %(describe) being inconsistent
t4205: assert %(describe) test coverage
pretty: add merge and exclude options to %(describe)
pretty: add %(describe)
Diffstat (limited to 't/t4205-log-pretty-formats.sh')
-rwxr-xr-x | t/t4205-log-pretty-formats.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index 85432b80ff..cabdf7d57a 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -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 |