Skip to content

Make it easier to review the changes introduced by a commit #335

Closed as not planned

Description

@raine

Reviewing the changes introduced by the latest commit currently requires Git revision syntax:

revdiff 'HEAD^' HEAD

or:

revdiff 'HEAD^!'

It would be helpful to have a more discoverable and memorable way to review a single commit, especially HEAD.

One possible approach would be a flag such as --show, but that is only an example. Any interface that makes this common operation easier and preserves the existing meaning of revdiff HEAD would address the use case.

Activity

  1. umputun commented on Sep 1, 2026

    @umputun
    Owner

    revdiff HEAD~1 HEAD already does this, and it works the same on git, hg and jj.

    the single-ref form compares against the working tree, so revdiff HEAD~1 picks up uncommitted changes too. On a clean tree it looks the same as the commit, which is why it seems to work. Two positional refs get joined into a range internally, so HEAD~1 HEAD is just the one commit.

    revdiff is primarily intended to be launched by an agent rather than typed by hand, and the plugin skills describe the two-ref form and only fall back to a bare HEAD~1 after confirming a clean tree. So the automatic path already avoids this.

    not planning to support HEAD^! though. It gives the right thing for an ordinary commit but not in general: on a merge it produces an empty diff, on a root commit it falls back to comparing against the working tree, and the commit list in the info popup errors out because a single ref gets rewritten to HEAD^!..HEAD for the log query. HEAD~1 HEAD is the portable spelling.

  2. raine commented on Sep 1, 2026

    @raine
    Author

    No worries. Forked this and made it work better for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions