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:
authorZheNing Hu <adlternative@gmail.com>2021-04-25 13:41:45 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-27 10:09:32 +0300
commitb722d4560e9d566cb8c6cdccf08d649df146eb6b (patch)
tree139de3aa4d73b836143c553ee3b1c7a51684e90e /t/t4205-log-pretty-formats.sh
parent3593ebd3f502d28eb405ce502cd9fbd743afc3fe (diff)
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) &&