Skip to content

FR: Ability to specify pager by diff-tool #8200

@sfleiter

Description

@sfleiter

Is your feature request related to a problem? Please describe.
Depending on the kind of diff I want to review I prefer either to view changes with difft aka difftastic or diffnav

Describe the solution you'd like

  • I want to be able to select the diff formater via --tool X without any need to change configuration or provide further parameters. For that the following is necessary
    • Setting the pager in the diff tool configuration since there are diff tools that can only work as a pager
    • Configure the output format that is send into the pager like with the --git parameter
    • (I wonder why diff formatting is configured via merge-tools.<name> but that is a different story I guess)

Describe alternatives you've considered
Overriding the pager and diff format for diffnav globally as described in docs

[ui]
pager = "diffnav"
diff-formatter = ":git"

When wanting to use difft, which is supposed to be my default, I have to run jj SOME_COMMAND --no-pager --tool difft instead of just jj SOME_COMMAND.
Also how much globally setting pager is a workaround is probably well documented in the scope tables section

Second alternative is this alias which is ugly since it destroys shell tab completion. I can use diffnav by calling jj diffnav SOME_COMMAND

[aliases]
diffnav = [  "util",  "exec",  "--",  "bash",  "-c",  """
jj "$@" --git | diffnav
""", "jj" ]

Additional context
I have probably wasted too much time to find these alternative options.
I am going to use the alias configuration for now.

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