Problem:
$ git status -s
MM myfile
$ git stash save
$ git show stash@{0}
# Only shows unstaged changes NOT staged changes
# To debug:
$ GIT_TRACE=2 git stash show
trace: exec: 'git-stash' 'show'
trace: run_command: 'git-stash' 'show'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--get-colorbool' 'color.interactive'
trace: built-in: git 'config' '--get-color' 'color.interactive.help' 'red bold'
trace: built-in: git 'config' '--get-color' '' 'reset'
trace: built-in: git 'rev-parse' '--no-flags' '--symbolic' '--sq'
trace: built-in: git 'rev-parse' '--symbolic-full-name' 'refs/stash'
trace: built-in: git 'diff' '--stat' 'aaaa' 'bbbb'
trace: run_command: 'pager'
trace: exec: 'pager'
$ git diff --stat aaaa bbbb
# Shows both staged and unstaged changes
$ git stash apply --index
$ git status -s
MM myfile
Why doesn't git show stash@{0} not show the staged changes that were supposed to be part of the stash? It appears that git-stash is silently hiding the staged changes in a stash.