mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
cli: in "show" template, indent description like Git does
This commit is contained in:
parent
8f8a9c91bc
commit
5d184e6694
2 changed files with 3 additions and 4 deletions
|
@ -60,7 +60,6 @@ show = 'show'
|
||||||
'format_timestamp(timestamp)' = 'timestamp'
|
'format_timestamp(timestamp)' = 'timestamp'
|
||||||
|
|
||||||
# TODO: Add branches, tags, etc
|
# TODO: Add branches, tags, etc
|
||||||
# TODO: Indent the description like Git does
|
|
||||||
'show' = '''
|
'show' = '''
|
||||||
concat(
|
concat(
|
||||||
"Commit ID: " ++ commit_id ++ "\n",
|
"Commit ID: " ++ commit_id ++ "\n",
|
||||||
|
@ -68,7 +67,7 @@ concat(
|
||||||
"Author: " ++ author ++ " (" ++ format_timestamp(author.timestamp()) ++ ")\n",
|
"Author: " ++ author ++ " (" ++ format_timestamp(author.timestamp()) ++ ")\n",
|
||||||
"Committer: " ++ committer ++ " (" ++ format_timestamp(committer.timestamp()) ++ ")\n",
|
"Committer: " ++ committer ++ " (" ++ format_timestamp(committer.timestamp()) ++ ")\n",
|
||||||
"\n",
|
"\n",
|
||||||
if(description, description, description_placeholder ++ "\n"),
|
indent(" ", if(description, description, description_placeholder ++ "\n")),
|
||||||
"\n",
|
"\n",
|
||||||
)
|
)
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -31,7 +31,7 @@ fn test_show() {
|
||||||
Author: Test User <test.user@example.com> (2001-02-03 04:05:07.000 +07:00)
|
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)
|
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...)
|
Author: Test User <test.user@example.com> (...timestamp...)
|
||||||
Committer: Test User <test.user@example.com> (...timestamp...)
|
Committer: Test User <test.user@example.com> (...timestamp...)
|
||||||
|
|
||||||
(no description set)
|
(no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue