ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: in "show" template, indent description like Git does

This commit is contained in:
Yuya Nishihara 2023-03-02 17:36:59 +09:00
parent 8f8a9c91bc
commit 5d184e6694
2 changed files with 3 additions and 4 deletions

View file

@ -60,7 +60,6 @@ show = 'show'
'format_timestamp(timestamp)' = 'timestamp'
# TODO: Add branches, tags, etc
# TODO: Indent the description like Git does
'show' = '''
concat(
"Commit ID: " ++ commit_id ++ "\n",
@ -68,7 +67,7 @@ concat(
"Author: " ++ author ++ " (" ++ format_timestamp(author.timestamp()) ++ ")\n",
"Committer: " ++ committer ++ " (" ++ format_timestamp(committer.timestamp()) ++ ")\n",
"\n",
if(description, description, description_placeholder ++ "\n"),
indent(" ", if(description, description, description_placeholder ++ "\n")),
"\n",
)
'''

View file

@ -31,7 +31,7 @@ fn test_show() {
Author: Test User <test.user@example.com> (2001-02-03 04:05:07.000 +07:00)
Committer: Test User <test.user@example.com> (2001-02-03 04:05:07.000 +07:00)
(no description set)
(no description set)
"###);
}
@ -60,6 +60,6 @@ fn test_show_relative_timestamps() {
Author: Test User <test.user@example.com> (...timestamp...)
Committer: Test User <test.user@example.com> (...timestamp...)
(no description set)
(no description set)
"###);
}