Skip to content

Commit

Permalink
templates: remove implicit self dependency from description_placehold…
Browse files Browse the repository at this point in the history
…er alias

Spotted while experimenting with "jj tag list -T". The description_placeholder
alias could be changed to function taking a Commit object, but I feel it's odd.
Conceptually, the placeholder could also be used in "op log" templates.
  • Loading branch information
yuja committed Apr 25, 2024
1 parent 50d18f4 commit 8f03a99
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions cli/src/config/templates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ if(root,
format_short_commit_id(commit_id),
if(conflict, label("conflict", "conflict")),
if(empty, label("empty", "(empty)")),
if(description, description.first_line(), description_placeholder),
if(description,
description.first_line(),
label(if(empty, "empty"), description_placeholder),
),
) ++ "\n",
),
)
Expand All @@ -58,7 +61,10 @@ if(root,
) ++ "\n",
separate(" ",
if(empty, label("empty", "(empty)")),
if(description, description.first_line(), description_placeholder),
if(description,
description.first_line(),
label(if(empty, "empty"), description_placeholder),
),
) ++ "\n",
),
)
Expand All @@ -74,7 +80,8 @@ concat(
"Author: " ++ format_detailed_signature(author) ++ "\n",
"Committer: " ++ format_detailed_signature(committer) ++ "\n",
"\n",
indent(" ", coalesce(description, description_placeholder ++ "\n")),
indent(" ",
coalesce(description, label(if(empty, "empty"), description_placeholder) ++ "\n")),
"\n",
)
'''
Expand All @@ -90,9 +97,7 @@ label(if(current_operation, "current_operation"),
'''
builtin_op_log_comfortable = 'builtin_op_log_compact ++ "\n"'


description_placeholder = '''
label(if(empty, "empty ") ++ "description placeholder", "(no description set)")'''
description_placeholder = 'label("description placeholder", "(no description set)")'
email_placeholder = 'label("email placeholder", "(no email set)")'
name_placeholder = 'label("name placeholder", "(no name set)")'
commit_summary_separator = 'label("separator", " | ")'
Expand Down Expand Up @@ -120,7 +125,10 @@ separate(" ",
separate(" ",
if(commit.conflict(), label("conflict", "(conflict)")),
if(commit.empty(), label("empty", "(empty)")),
if(commit.description(), commit.description().first_line(), description_placeholder),
if(commit.description(),
commit.description().first_line(),
label(if(commit.empty(), "empty"), description_placeholder),
),
),
),
)
Expand Down

0 comments on commit 8f03a99

Please sign in to comment.