Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ if(commit.root(),
),
concat(
separate(" ",
format_short_change_id_with_hidden_and_divergent_info(commit),
format_short_change_id_with_change_offset(commit),
format_short_signature_oneline(commit.author()),
format_timestamp(commit_timestamp(commit)),
commit.commit_id().short(20),
commit.bookmarks(),
commit.tags(),
commit.working_copies(),
if(commit.git_head(), label("git_head", "git_head()")),
if(commit.conflict(), label("conflict", "conflict")),
format_commit_labels(commit),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The use of format_commit_labels(commit) here introduces redundant information in the commit one-line format. The ONELINE_COMMIT_BIGHEX template already adds labels for immutable/mutable (line 59) and conflicted (line 60) at the beginning of the line. The format_commit_labels() function, by default, also adds labels for conflict, immutable, and hidden states. This will result in duplicate labels in the output, for example, a conflicted commit will show conflicted at the start and conflict later in the line. This can be confusing.

If the goal is to add a label for hidden commits, it would be better to add it explicitly to avoid redundancy.

Suggested change
format_commit_labels(commit),
if(commit.hidden(), label("hidden", "hidden")),

if(config("ui.show-cryptographic-signatures").as_boolean(),
format_short_cryptographic_signature(commit.signature())),
if(commit.empty(), label("empty", "(empty)")),
Expand Down
2 changes: 1 addition & 1 deletion lib/evolog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TITLE='Evolution Log'
export JJFZF_EVOLOG_SRC=$(jj --no-pager --ignore-working-copy log --no-graph -T commit_id -r "${1-@}")
LONG_IDS="--config=template-aliases.'format_short_change_id(id)'='id.shortest(32)'"
FOOTER="$TITLE for Change ID:"$'\n'
FOOTER="$FOOTER"$(jj --no-pager --ignore-working-copy log --no-graph $LONG_IDS $JJFZF_COLOR -T 'format_short_change_id_with_hidden_and_divergent_info(self)' -r "${1-@}")
FOOTER="$FOOTER"$(jj --no-pager --ignore-working-copy log --no-graph $LONG_IDS $JJFZF_COLOR -T 'format_short_change_id_with_change_offset(self)' -r "${1-@}")
jjfzf_log_detailed # for preview, assigns $JJFZF_LOG_DETAILED_CONFIG
B=() H=()

Expand Down