Skip to content

FR: Support --template for jj describe and related commands #10017

Description

@frxstrem

Is your feature request related to a problem? Please describe.

When I want to update the description of many commits in bulk, for example to add a trailer to each commit, or strip a wip: prefix that I often put in front of my commits while working on them, I need to either call jj describe interatively, or call it once for each commmit in sequence.

Describe the solution you'd like

It would be very nice if jj describe supported --template as an alternative to --message, which could generate the message for each commit based on a template expression.

For example, to add a trailer to all commits, one could then do

jj describe -r 'my_revset()' --template 'description ++ "\n\nMy-trailer: Something Something"'

It would also be nice if this applied to other commands that take --message, such as jj new and jj commit.

Describe alternatives you've considered

As mentioned, I could do the same interactively. If it involves a large number of commits, I would likely need to do some scripting within my editor, though.

Alternatively, I could do this in a three-step process, running several jj commands (possibly scripted):

  1. Expand revset to a list of commits
  2. For each commit, read the existing description (or other fields that the new description would be based on)
  3. For each commit, run jj describe to update the description

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions