{"thread":{"id":"33521","subject":"[PATCH] t3903 (stash): add failing test for ref of form ^{/message}","startedAt":"2013-04-16T18:07:23Z","lastAt":"2013-04-16T18:07:23Z","messageCount":1,"participants":["Ramkumar Ramachandra"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"214507","messageId":"1366135643-18358-1-git-send-email-artagnon@gmail.com","threadId":"33521","inReplyTo":null,"subject":"[PATCH] t3903 (stash): add failing test for ref of form ^{/message}","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-04-16T18:07:23Z","receivedAt":"2013-04-16T18:07:23Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"While a 'git stash show stash^{/quuxery}' works just fine, a 'git\nstash pop stash^{/quuxery}' complains with: 'stash^{/quuxery} is not a\nstash reference'.  This confusing behavior arises from the differences\nin logic that 'show' and 'pop' internally employ to validate the\nspecified ref.  Document this bug by adding a failing testcase for it.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n So if you look at git-stash.sh:377, you'll notice that it's doing a\n the shell substitution \"${REV%@*}\" to figure out whether the stash\n ref is a valid ref.  This hacky myopic design has to be done away\n with immediately, and we should really compare the SHA-1 hex of the\n specified ref with those in the stash reflog.\n\n The only reason I haven't written a fix yet is because I'm not sure\n why you need this convoluted IS_STASH_LIKE and IS_STASH_REF logic in\n the first place.  Can someone enlighten me as to what is going on?\n\n t/t3903-stash.sh | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 5dfbda7..04ba983 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -583,6 +583,15 @@ test_expect_success 'invalid ref of the form stash@{n}, n >= N' '\n \tgit stash drop\n '\n \n+test_expect_failure 'valid ref of the form stash^{/message}' '\n+\tgit stash clear &&\n+\techo bar > file &&\n+\tgit add file &&\n+\tgit stash save \"quuxery\" &&\n+\tgit stash show stash^{/quuxery} &&\n+\tgit stash pop stash^{/quuxery}\n+'\n+\n test_expect_success 'stash branch should not drop the stash if the branch exists' '\n \tgit stash clear &&\n \techo foo >file &&\n-- \n1.8.2.1.390.g924f6c3.dirty\n"}]}