I want to display a patch for a single file of a certain stash. Usually with git-diff
you can append the -- <pathspec>
to limit the output.
Now the git-stash
manpage states the following for the show
command...
By default, the command shows the diffstat, but it will accept
any format known to git diff
... but unfortunately it does not accept a trailing pathspec, so the following command won't work
$ git stash show -p --include-untracked stash@{0} -- test/foo.txt
Too many revisions specified: 'stash@{0}' 'test/foo.txt'
The reason I want to use git-stash
for this is because it has the --include-untracked
option. Is there a way to limit the output to a specific pathspec, or emulate the behavior of
git stash show -p --include-untracked stash@{0}
with a regular git-diff
call?