Skip to content

Divergent revision parsing depends on jj log template #545

@locksten

Description

@locksten

Description

I don't use ids in the log template (jjui is so good I rarely need them).
Ran into a parsing error when trying to interact with divergent changes.
Worked around it by prepending divergent commits with the jj v0.37 change-id-with-offset (jjui could potentially start using it in it's log prefix?).
Just wanted to share the workaround in case anyone else runs into the same error:

[template-aliases]
format_short_commit_header(commit) = '''
  separate(" ",
    if(commit.divergent(), format_short_change_id_with_change_offset(commit), ""),
    commit_timestamp(commit).ago(),
    format_short_signature(commit.author()),
    commit.bookmarks(),
    commit.tags(),
    commit.working_copies(),
    format_commit_labels(commit),
  )
'''

Steps to Reproduce the Problem

Use a jj template alias like this:

[template-aliases]
format_short_commit_header(commit) = '''
  separate(" ",
    commit_timestamp(commit).ago(),
    format_short_signature(commit.author()),
    commit.bookmarks(),
    commit.tags(),
    commit.working_copies(),
    format_commit_labels(commit),
  )
'''

Try to expand or abandon a divergent change.

Expected Behavior

The divergent change is expanded or abandoned.

Actual Behavior

Error: Failed to parse revset: Syntax error
Caused by:  --> 1:4
  |
1 | 20 hours ago
  |    ^---
  |
  = expected <EOI>, `|`, `&`, or `~`

Specifications

  • Platform: NixOS
  • JJUI Version: main-720520c
  • JJ Version: 0.38.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions