path: root/
diff options
authorJeff King <>2014-08-06 18:35:25 (GMT)
committerJunio C Hamano <>2014-08-07 21:37:28 (GMT)
commit288c67caf64af111aeb7c45cb8b6ba586a61c724 (patch)
tree37761c65c970123072f59d3cbdf0700ed9d4ef6b /
parentd31f3ad23dd1aee3c3e1015a43b02b995c01a9a1 (diff)
stash: default listing to working-tree diff
When you list stashes, you can provide arbitrary git-log options to change the display. However, adding just "-p" does nothing, because each stash is actually a merge commit. This implementation detail is easy to forget, leading to confused users who think "-p" is not working. We can make this easier by defaulting to "--first-parent -m", which will show the diff against the working tree. This omits the index portion of the stash entirely, but it's simple and it matches what "git stash show" provides. People who are more clueful about stash's true form can use "--cc" to override the "-m", and the "--first-parent" will then do nothing. For diffs, it only affects non-combined diffs, so "--cc" overrides it. And for the traversal, we are walking the linear reflog anyway, so we do not even care about the parents. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 1 insertions, 1 deletions
diff --git a/ b/
index 4798bcf..091c95c 100755
--- a/
+++ b/
@@ -296,7 +296,7 @@ have_stash () {
list_stash () {
have_stash || return 0
- git log --format="%gd: %gs" -g "$@" $ref_stash --
+ git log --format="%gd: %gs" -g --first-parent -m "$@" $ref_stash --
show_stash () {