问题:
$ 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
为什么 git show stash@{0} 不显示应该是存储的一部分的分阶段更改?似乎 git-stash 正在默默地将分阶段的更改隐藏在存储中。