threads / discuss / 65004

[feature request] stash diff usability

Subject: [feature request] stash diff usability

## tl;dr

3 messages between Feb 16, 2026 and Feb 16, 2026.

replies: 2people: 2as markdown or json

Pierre Houston· Feb 16, 2026, 00:56 UTC · lore

I can't recall wanting to get, from the command line, the contents of a stash as a diff in the past. I thought there was maybe an option to `git stash show` , boy was I wrong: `git diff 'stash@{0}^' 'stash@{0}'`. This seems rather user hostile.

I see the request to get the "!" syntax working, this would be an improvement, However, I'd like to see the command `git stash diff [stashname]` to be a shorthand for the above, and of course defaulting to the most recent stash.

My apologies if this matches an old, previously rejected suggestion. Searching the mailing list exhaustively takes some skill I haven't acquired.

Eric Sunshine· Feb 16, 2026, 01:05 UTC · re: Pierre Houston · lore

Re: [feature request] stash diff usability

On Sun, Feb 15, 2026 at 7:57 PM Pierre Houston <jpmhouston@gmail.com> wrote:
> I can't recall wanting to get, from the command line, the contents of
> a stash as a diff in the past. I thought there was maybe an option to
> `git stash show` , boy was I wrong: `git diff 'stash@{0}^'
> 'stash@{0}'`. This seems rather user hostile.

What you probably want is `git stash show -p`, which is documented indirectly as "<diff-option>" in the git-stash man page for the "show" subcommand.

Eric Sunshine· Feb 16, 2026, 07:07 UTC · lore

Re: [feature request] stash diff usability

On Sun, Feb 15, 2026 at 8:20 PM Pierre Houston <jpmhouston@gmail.com> wrote:
> Ok, egg on my face, thanks. I should have looked in more places for that option.

No egg intended. By saying that it is documented only *indirectly*, I meant that it is not necessarily easy to discover.

> I would like to see a long spelling of that option with “--“ for better discoverability.

A patch to the git-stash documentation to mention this useful option more explicitly might be welcome, if you want to give it a shot. In fact, it might be a good idea to call out --patch for both the git-stash "show" and "list" commands.

← back to recent threads