Skip to content

Including --stat in fugitive commit view #2448

@tonystr

Description

@tonystr

Hello, when working with git in the terminal, I like to use git show -p --stat <rev>, which gives a helpful overview over files changed[0] before the diffs for the commit.

I initially tried to replicate this with :Gedit --stat <rev>, but just got an empty buffer. Looking into the code, I see that the git command for git show ... <rev> is hard coded, with a very specific --pretty=format:... (presumably for highlighting), so understandably it would be difficult to allow arbitrary flags to git show through :Gedit.

Neogit shows this --stat output by default in their commit view[1]. I hacked it in locally to see how it would look in fugitive[1].

If interesting to others, I could implement this with highlighting either as standard or as an option (I believe the code supports ++flags), otherwise I might just fork for my self.

[0] - git show -p --stat <rev> output:
Image

[1] - vim-fugitive :Gedit modified to include -p --stat on the left, and Neogit's :NeogitCommit on the right:
Image

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