{"thread":{"id":"15700","subject":"[PATCH] Clarify how the user can satisfy stash's 'dirty state' check.","startedAt":"2008-09-29T09:12:04Z","lastAt":"2008-09-29T09:12:04Z","messageCount":1,"participants":["Stephen Haberman"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"91830","messageId":"20080929041204.846ba617.stephen@exigencecorp.com","threadId":"15700","inReplyTo":null,"subject":"[PATCH] Clarify how the user can satisfy stash's 'dirty state' check.","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-09-29T09:12:04Z","receivedAt":"2008-09-29T09:12:04Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"Clarify how the user can satisfy stash's 'dirty state' check.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n\nFeel free to tweak the wording, but we had a false assumption that you\ncould not apply multiple stashes in a row due to this confusing error\nmessage. I.e. \"dirty state\" was taken as \"dirty working tree and/or\nindex\" instead of just \"dirty working tree\".\n\nI don't have any tests, but t3903-stash.sh runs the same (\"10: stash\nbranch\" is failing both before and after my change change).\n\nLooking into it more, I dislike that t3903's \"3: apply needs clean\nworking directory\" uses test_must_fail because without actively\nasserting that the expected error message comes back, we can't be sure\nthe boundary condition that was originally tested for is still being met\n(e.g. `git stash` could be returning non-zero for some entirely\ndifferent reason now--not likely, yes, but possible). test_must_fail\nmentions a \"segv\" reason, which I'll somewhat blindly accept as good,\nbut it would be nice if I could pass in/grep against/something the error\nmessage. Perhaps on another line/invocation?\n\nAnyway...the patch:\n\n git-stash.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex e15c12a..a932ca7 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -151,7 +151,7 @@ show_stash () {\n \n apply_stash () {\n \tgit diff-files --quiet --ignore-submodules ||\n-\t\tdie 'Cannot restore on top of a dirty state'\n+\t\tdie 'Cannot apply to a dirty working tree, please stage your changes'\n \n \tunstash_index=\n \tcase \"$1\" in\n-- \n1.6.0.2\n"}]}