-
Notifications
You must be signed in to change notification settings - Fork 830
Description
Is your feature request related to a problem? Please describe.
My templates.log setting displays the diff summary for commits without a description:
builtin_log_compact
++ if(
!description && !empty,
diff.summary(),
)
Then, jj log generally gives me the same information as jj status:
@ pyqytpqy [email protected] 2025-08-28 11:13:22 1e191128
│ (no description set)
│ A foo.txt
◆ lslqzoxm [email protected] 2025-08-27 22:51:40 main git_head() 35bbfbd6
│ wezterm: don't hyperlink emails
~
The main case in which jj log fails to give me the information I want is if there are conflicts in a commit. Here, the top commit has a conflict in foo.txt, but I won't know which file unless I run jj status or jj resolve --list --revision x:
@ xtklzslm [email protected] 2025-08-28 11:17:44 9292b5b8 conflict
├─╮ (empty) (no description set)
│ ○ pyqytpqy [email protected] 2025-08-28 11:17:33 e49a3c77
│ │ (no description set)
│ │ A foo.txt
○ │ mrpqqryn [email protected] 2025-08-28 11:17:42 git_head() d4ddbddb
├─╯ (no description set)
│ A foo.txt
◆ lslqzoxm [email protected] 2025-08-27 22:51:40 main 35bbfbd6
│ wezterm: don't hyperlink emails
~
I have a workaround for this, but the ergonomics aren't great:
if(
conflict,
self.files(
"all()"
).filter(
|file| file.conflict()
).map(
|file| label(
"conflict",
concat("conflict ", file.path())
)
).join("\n")
)
Which displays like this:
$ jj
@ xtklzslm [email protected] 2025-08-28 11:33:18 65a41cc4 conflict
├─╮ (no description set)
│ │ conflict foo.txt
...
Describe the solution you'd like
I would like a conflicts() fileset expression (edit: this is tracked by #5213) which resolves to a list of files containing conflicts. I would also like access to additional metadata on conflicts, e.g. how many sides are included in a conflict.
I would also like access to the cli::cli_util::print_conflicted_paths function in templates, perhaps as builtin_conflicted_paths.
Describe alternatives you've considered
It might make sense for the diff.summary() information to include conflicts by default, although it seems like jj doesn't view conflicts as "part of the diff".
It would also be nice to have access to information on the individual conflicts in a commit, e.g. which lines they occur on.