Skip to content

Confusing behavior of jj log when combining --stat with --patch or --git #5986

@botovq

Description

@botovq

In Git, you can do git log --stat --patch and you will be shown first the histogram and then the diff independent of the order of the options and the result is close to the default git format-patch output.

Jujutsu, on the other hand, has confusing (to me) behavior.

  • jj log --stat --patch only shows the histogram, no patch.
  • jj log --stat --git only shows the git-style diff, but no histogram.

From the help text is not clear to me why --stat should win over --patch and why --git wins over --stat. Maybe this can be explained to some extent with --stat being a diff formatting option, but then the question arises why combining --git and --color-words emits the error that they can't be combined while --stat and --git don't.

Similarly, I think jj diff --stat --git should show both a histogram and a diff.

The supporting code in DiffFormatArgs is quite a bit more complicated thant I would have expected it to be.

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