cli: move default "show" template to alias

I'm not pretty sure if this is structurally good, but 'jj log -T show'
is useful.
This commit is contained in:
Yuya Nishihara 2023-02-15 00:28:36 +09:00
parent 65ff1afb0d
commit 0abf9ce8cd

View file

@ -26,9 +26,15 @@ label(if(current_working_copy, "working_copy"),
)
'''
# Defined as alias to allow 'log -T show'
show = 'show'
[template-aliases]
'description_placeholder' = 'label("description", "(no description set)")'
# TODO: Add branches, tags, etc
# TODO: Indent the description like Git does
show = '''
'show' = '''
"Commit ID: " commit_id "\n"
"Change ID: " change_id "\n"
"Author: " author " (" format_timestamp(author.timestamp()) ")\n"
@ -37,6 +43,3 @@ show = '''
if(description, description, description_placeholder "\n")
"\n"
'''
[template-aliases]
'description_placeholder' = 'label("description", "(no description set)")'