summaryrefslogtreecommitdiff
path: root/t/t4205-log-pretty-formats.sh
diff options
context:
space:
mode:
authorLibravatar ZheNing Hu <adlternative@gmail.com>2021-04-25 10:41:45 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-04-27 16:09:32 +0900
commitb722d4560e9d566cb8c6cdccf08d649df146eb6b (patch)
tree139de3aa4d73b836143c553ee3b1c7a51684e90e /t/t4205-log-pretty-formats.sh
parentpretty tests: give --date/format tests a better description (diff)
downloadtgif-b722d4560e9d566cb8c6cdccf08d649df146eb6b.tar.xz
pretty: provide human date format
Add the placeholders %ah and %ch to format author date and committer date, like --date=human does, which provides more humanity date output. Signed-off-by: ZheNing Hu <adlternative@gmail.com> 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.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index bcb558ef4d..8272d94ce6 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -538,6 +538,12 @@ test_expect_success '--date=short %ad%cd is the same as %as%cs' '
test_cmp expected actual
'
+test_expect_success '--date=human %ad%cd is the same as %ah%ch' '
+ git log --format=%ad%n%cd --date=human >expected &&
+ git log --format=%ah%n%ch >actual &&
+ test_cmp expected actual
+'
+
# get new digests (with no abbreviations)
test_expect_success 'set up log decoration tests' '
head1=$(git rev-parse --verify HEAD~0) &&