git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Support -- pathspec in git-stash show command

From
EAErik Aigner <erik@bytieful.com>
Date
May 2, 2022, 16:01 UTC
Message-ID
<52447774-42E2-4578-8AB9-6F355E56CA80@bytieful.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
1) Create a stash containing multiple files including `foo/bar.txt`
2) perform `git stash show -p stash@{0} -- foo/bar.txt
What did you expect to happen? (Expected behavior)
The stash patch output would be limited to only the provided pathspec `foo/bar.txt`
What happened instead? (Actual behavior)
Error message "Too many revisions specified: 'stash@{0}' 'test/foo.txt'"
What's different between what you expected and what actually happened?

The manpage for git-stash states that the SHOW command should support any argument the git-diff command also accepts, but apparently the trailing "-- <pathspec>" does not work with "git stash show".

Anything else you want to add:

For symmetry with git-diff, git-show should also support a pathspec parameter. The reason for this is that `git stash show` has the stash specific `--include-untracked` paramenter, which git-diff doesn't have.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.32.0 (Apple Git-132) cpu: arm64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Darwin 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 arm64 compiler info: clang: 13.1.6 (clang-1316.0.21.2.3) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks] pre-commit

Message 1 of 1 in “Support -- pathspec in git-stash show command”
  1. Erik AignerMay 2, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.