Thread (19 messages) flat view 19 messages, 6 authors, 2016-06-15

Re: git-1.7.3 breakage: "git stash show xxx" doesn't show anything

From: Brandon Casey <hidden>
Date: 2016-06-15 22:49:36
Subsystem: the rest · Maintainer: Linus Torvalds

On 09/24/2010 02:19 PM, Robin H. Johnson wrote:
Downstream bug: http://bugs.gentoo.org/338586

telling git-stash to show a specific stash no longer works with git-1.7.3:
  git stash show stash@{0}
  <no output!?>

Downgrading to dev-vcs/git-1.7.2.3 and it works fine.
Noticed on two stable amd64 systems.

Reproduction:
$ rm -rf foo && mkdir foo && cd foo
$ git init
Initialized empty Git repository in /home/vapier/foo/.git/
$ echo f > f && git add f && git commit -qmm
$ > f
$ git stash
Saved working directory and index state WIP on master: d287dea m
HEAD is now at d287dea m
$ git stash list | cat
stash@{0}: WIP on master: d287dea m
$ git stash show | cat
 f |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
$ git stash show stash@{0} | cat
<nothing!>
Probably,
diff --git a/git-stash.sh b/git-stash.sh
index 7ce818b..4fbfb62 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -265,7 +265,7 @@ parse_flags_and_rev()
        i_tree=
 
        REV=$(git rev-parse --no-flags --symbolic "$@" 2>/dev/null)
-       FLAGS=$(git rev-parse --no-revs -- "$@" 2>/dev/null)
+       FLAGS=$(git rev-parse --no-revs --flags "$@" 2>/dev/null)
 
        set -- $FLAGS
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help