{"thread":{"id":"11381","subject":"[PATCH] Make \"git stash\" configurable","startedAt":"2007-12-21T10:22:20Z","lastAt":"2007-12-22T18:44:15Z","messageCount":11,"participants":["しらいしななこ","Steven Grimm","Matthieu Moy","Junio C Hamano","Wincent Colaiuta"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63911","messageId":"200712211026.lBLAQWWM014059@mi0.bluebottle.com","threadId":"11381","inReplyTo":null,"subject":"[PATCH] Make \"git stash\" configurable","fromName":"しらいしななこ","fromEmail":"nanako3@bluebottle.com","sentAt":"2007-12-21T10:22:20Z","receivedAt":"2007-12-21T10:22:20Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"\"git stash\" without argument originally created an unnamed\nstash, but some people felt this can be confusing to new\nusers.  This introduces per-user config variable stash.quick to\ncontrol this behavior.\n\nThe variable can take one of three values: true, false, ask.\n\nWhen set to \"true\", the command allows to create a quick\nstash without any user interaction.  When set to \"false\",\nthe command shows the list of stash instead.  When set to\n\"ask\", the command asks the user.\n\nFor the first time users, when the variable is not set,\nthe command helps the user to set it interactively.\n\nSigned-off-by: Nanako Shiraishi <nanako3@bluebottle.com>\n---\n Documentation/git-stash.txt |   17 +++++++++-\n git-stash.sh                |   72 +++++++++++++++++++++++++++++++++++++++++-\n 2 files changed, 85 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex c0147b9..5d39da2 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -22,11 +22,24 @@ and reverts the working directory to match the `HEAD` commit.\n The modifications stashed away by this command can be listed with\n `git-stash list`, inspected with `git-stash show`, and restored\n (potentially on top of a different commit) with `git-stash apply`.\n-Calling git-stash without any arguments is equivalent to `git-stash\n-save`.  A stash is by default listed as \"WIP on 'branchname' ...\", but\n+A stash is by default listed as \"WIP on 'branchname' ...\", but\n you can give a more descriptive message on the command line when\n you create one.\n \n+Calling git-stash without any arguments is equivalent to `git-stash\n+save` when the command is run non-interactively.  When running\n+interactively, the value of the `stash.quick` configuration\n+variable in `$HOME/.gitconfig` determines what happens.\n+\n+ - If `stash.quick` is set to `true`, a stash without message is\n+   created.\n+\n+ - If `stash.quick` is set to `false`, it shows the list of\n+   stash, without creating a new one.\n+\n+ - If `stash.quick` is set to `ask`, the user is asked which\n+   behavior is desired.\n+\n The latest stash you created is stored in `$GIT_DIR/refs/stash`; older\n stashes are found in the reflog of this reference and can be named using\n the usual reflog syntax (e.g. `stash@\\{0}` is the most recently\ndiff --git a/git-stash.sh b/git-stash.sh\nindex f16fd9c..b6223bd 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -192,6 +192,69 @@ apply_stash () {\n \tfi\n }\n \n+allow_quick_stash () {\n+\n+\tquick=$(git config --global stash.quick)\n+\tif test $? != 0\n+\tthen\n+\t\tif ! test -t 0 || ! test -t 1\n+\t\tthen\n+\t\t\treturn 0\n+\t\tfi\n+\n+\t\techo '\n+*** First time users ***\n+\n+\"git stash\" can create an unnamed stash entry without user interaction.\n+This is a quick way to save away your work in progress.  Some people\n+find this behaviour confusing or dangerous to new users.  You can\n+configure the command to list the existing stash entries instead.'\n+\n+\t\twhile :\n+\t\tdo\n+\t\t\techo '\n+Do you want the command without argument to always...\n+\n+1. Ask for confirmation\n+2. Create an unnamed stash\n+3. List existing stash entries\n+'\n+\t\t\tprintf 'Which one? [1/2/3] '\n+\t\t\tread reply\n+\t\t\tquick=\n+\t\t\tcase \"$reply\" in\n+\t\t\t1|A*)\tquick=ask ;;\n+\t\t\t2|C*)\tquick=true ;;\n+\t\t\t3|L*)\tquick=false ;;\n+\t\t\t*)\tcontinue ;;\n+\t\t\tesac\n+\t\t\tbreak\n+\t\tdone\n+\t\tgit config --global stash.quick $quick\n+\t\techo '\n+You can reconfigure this by editing your $HOME/.gitconfig file'\n+\n+\tfi\n+\n+\tcase \"$quick\" in\n+\ttrue)\treturn 0 ;;\n+\tfalse)\treturn 1 ;;\n+\task)\t: do not return ;;\n+\tesac\n+\n+\tif ! test -t 0 || ! test -t 1\n+\tthen\n+\t\treturn 0\n+\tfi\n+\n+\tprintf 'Do you want to create an unnamed stash? [Y/n] '\n+\tread reply\n+\tcase \"$reply\" in\n+\t[nN]*)\treturn 1 ;;\n+\t*)\treturn 0 ;;\n+\tesac\n+}\n+\n # Main command set\n case \"$1\" in\n list)\n@@ -226,11 +289,16 @@ create)\n \tcreate_stash \"$*\" && echo \"$w_commit\"\n \t;;\n *)\n-\tif test $# -eq 0\n+\tif test $# -ne 0\n+\tthen\n+\t\tusage\n+\tfi\n+\tif allow_quick_stash\n \tthen\n \t\tsave_stash && git-reset --hard\n \telse\n-\t\tusage\n+\t\techo \"*** Stash List ***\"\n+\t\tlist_stash\n \tfi\n \t;;\n esac\n-- \n1.5.3.7\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n\n----------------------------------------------------------------------\nFree pop3 email with a spam filter.\nhttp://www.bluebottle.com/tag/5\n"},{"id":"63935","messageId":"2AB285BD-DA6E-49D1-B664-B1A8B552DD76@midwinter.com","threadId":"11381","inReplyTo":"200712211026.lBLAQWWM014059@mi0.bluebottle.com","subject":"Re: [PATCH] Make \"git stash\" configurable","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-12-21T17:23:47Z","receivedAt":"2007-12-21T17:23:47Z","isPatch":true,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"On Dec 21, 2007, at 2:22 AM, しらいしななこ wrote:\n\n> \"git stash\" without argument originally created an unnamed\n> stash, but some people felt this can be confusing to new\n> users.  This introduces per-user config variable stash.quick to\n> control this behavior.\n\nThis whole thing smells of indecision to me. We should figure out a  \nbehavior we want and go with it. Git's command line interface is  \nalready confusing enough without adding this kind of variability --  \nany new user is going to look at this and say, \"Why couldn't they just  \nmake up their minds?\"\n\nMy vote is to require \"save\". We already have an alias mechanism that  \npeople can use to turn \"git stash save\" into a two-word command. And I  \nsay this as someone who runs \"git stash\" and will have to retrain his  \nfingers.\n\n-Steve (who thinks \"trying to please everyone at all times\" is usually  \na source of bad UI design decisions)"},{"id":"63936","messageId":"vpq4pec7yb8.fsf@bauges.imag.fr","threadId":"11381","inReplyTo":"2AB285BD-DA6E-49D1-B664-B1A8B552DD76@midwinter.com","subject":"Re: [PATCH] Make \"git stash\" configurable","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-12-21T17:27:39Z","receivedAt":"2007-12-21T17:27:39Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Steven Grimm <koreth@midwinter.com> writes:\n\n> Git's command line interface is already confusing enough without\n> adding this kind of variability\n\nIt also makes portable scripts harder. It's easy to write a script\nthat works only if you have the option set ...\n\n-- \nMatthieu\n"},{"id":"63942","messageId":"7v3atw7x33.fsf@gitster.siamese.dyndns.org","threadId":"11381","inReplyTo":"vpq4pec7yb8.fsf@bauges.imag.fr","subject":"Re: [PATCH] Make \"git stash\" configurable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-21T17:54:08Z","receivedAt":"2007-12-21T17:54:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Steven Grimm <koreth@midwinter.com> writes:\n>\n>> Git's command line interface is already confusing enough without\n>> adding this kind of variability\n>\n> It also makes portable scripts harder. It's easy to write a script\n> that works only if you have the option set ...\n\nIn general I'd agree but in this particular case I do not think\nthat applies.  Scripts can always say what they want, either\n\"stash save\" or \"stash list\".\n"},{"id":"63943","messageId":"74FF0697-8157-4308-8BA4-A1C7D0C7D260@midwinter.com","threadId":"11381","inReplyTo":"7v3atw7x33.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Make \"git stash\" configurable","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-12-21T18:26:16Z","receivedAt":"2007-12-21T18:26:16Z","isPatch":true,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"On Dec 21, 2007, at 9:54 AM, Junio C Hamano wrote:\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>> It also makes portable scripts harder. It's easy to write a script\n>> that works only if you have the option set ...\n>\n> In general I'd agree but in this particular case I do not think\n> that applies.  Scripts can always say what they want, either\n> \"stash save\" or \"stash list\".\n\nI bet Matthieu meant that it's easy for someone who runs bare \"git  \nstash\" all the time to forget that there's an option to make that  \ncommand do something different, and to thus code up a local script  \nthat runs the command as they're used to running it. Such a script  \nwill work just fine for them but it'll break as soon as they give it  \nto someone else who has the option set differently.\n\n-Steve\n"},{"id":"63947","messageId":"7vmys36d7n.fsf@gitster.siamese.dyndns.org","threadId":"11381","inReplyTo":"2AB285BD-DA6E-49D1-B664-B1A8B552DD76@midwinter.com","subject":"Re: [PATCH] Make \"git stash\" configurable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-21T19:48:44Z","receivedAt":"2007-12-21T19:48:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steven Grimm <koreth@midwinter.com> writes:\n\n> On Dec 21, 2007, at 2:22 AM, しらいしななこ wrote:\n>\n>> \"git stash\" without argument originally created an unnamed\n>> stash, but some people felt this can be confusing to new\n>> users.  This introduces per-user config variable stash.quick to\n>> control this behavior.\n>\n> This whole thing smells of indecision to me.\n\nIf you want to force me to decide, you know what the decision it\nwould be.  Here are the guiding principles and decisions based\non them.\n\n (1) A tool should be optimized for people who know what it does\n     and how to use it.\n\n     While forbidding \"git stash\" without argument and forcing\n     people who want to have a quick stash to type \"git stash\n     save\" may appear not to be adding too many keystrokes, it\n     actually is a regression.  Because \"git stash save\" without\n     arguments make a much less descriptive stash than the\n     current quickie \"git stash\", doing so slows them down by\n     forcing them to think of what message to give.\n\n     The decision would be to keep \"git stash\" quickie stash\n     creation.  An alternative decision could be to do nothing\n     when \"git stash\" is given, and make \"git stash save\" (and\n     \"git stash create\") without the actual message to come up\n     with a better default message.\n\n (2) A tool should not change its behaviour too drastically\n     depending on who the user is.\n\n     Otherwise it makes it harder for people with mid-level\n     experience to teach less experienced people.  The decision\n     would be that \"stash.quick=ask\" and \"stash.quick=no\" are\n     unacceptable.\n\n (3) A tool should support safety for a mistaken use by who know\n     the tool (even they can make mistakes).\n\n     I listed this mostly because we made \"git clean\" to violate\n     principle (2) above.  Even when you know what that command\n     does, it is easy to mean \"make clean\" and type \"git clean\"\n     by mistake.  And \"git clean\" is very destructive --- there\n     is no \"oops, I take it back\".  This principle has led us to\n     introduce clean.requireforce that defaults to true.\n\n     For \"git stash\", there is no \"make stash\" or \"xyzzy stash\"\n     that can easily induce mistyping.  Even if it were typed by\n     mistake, there is no such destructive \"oops, I cannot take\n     it back\" problem with \"git stash\", either.  \"git stash\n     apply\" will get you back to where you were.  The decision\n     would again be that \"stash.quick=no\" is unwanted.\n\n (4) A tool should support safety for clueless people when it is\n     reasonable.\n\n     Even though \"I did not know what command foo does, so I\n     tried running it and it did something unexpected\" is a\n     silly excuse to rob quickie \"git stash\" from people who\n     know better, we cannot avoid the fact that there are\n     clueless people.  I think checking stash.iknowwhatitdoes to\n     detect first-time users, and explaining what it does to\n     them, may make sense.  And we can take hints from the patch\n     that started this thread how to do this.\n\n     The decision here is that I am open to a change that\n     implements the one-time safety instruction.\n\nNote that in the above guiding principles, I used \"should\" in\nRFC2119/BCP0014 sense: there may exist valid reasons in\nparticular circumstances to ignore a particular item, but the\nfull implications must be understood and carefully weighed\nbefore choosing a different course.\n"},{"id":"63994","messageId":"1198333369-17788-1-git-send-email-win@wincent.com","threadId":"11381","inReplyTo":"7vmys36d7n.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Emit helpful status for accidental \"git stash\" save","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-22T14:22:49Z","receivedAt":"2007-12-22T14:22:49Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 21/12/2007, a las 20:48, Junio C Hamano escribiÃ³:\n\n> (4) A tool should support safety for clueless people when it is\n>    reasonable.\n>\n>    Even though \"I did not know what command foo does, so I\n>    tried running it and it did something unexpected\" is a\n>    silly excuse to rob quickie \"git stash\" from people who\n>    know better, we cannot avoid the fact that there are\n>    clueless people.  I think checking stash.iknowwhatitdoes to\n>    detect first-time users, and explaining what it does to\n>    them, may make sense.  And we can take hints from the patch\n>    that started this thread how to do this.\n>\n>    The decision here is that I am open to a change that\n>    implements the one-time safety instruction.\n\nHere's a less invasive change that I think addresses this point (4)\nthat you make.\n\n-- 8< --\nEmit helpful status for accidental \"git stash\" save\n\nIf the user types \"git stash\" mistakenly thinking that this will list\ntheir stashes he/she may be surprised to see that it actually saved\na new stash and reset their working tree and index.\n\nIn the worst case they might not know how to recover the state. So\nhelp them by telling them exactly what was saved and also how to\nrestore it immediately.\n\nSigned-off-by: Wincent Colaiuta <win@wincent.com>\n---\n git-stash.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex f16fd9c..a2f3723 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -99,7 +99,8 @@ save_stash () {\n \n \tgit update-ref -m \"$stash_msg\" $ref_stash $w_commit ||\n \t\tdie \"Cannot save the current status\"\n-\tprintf >&2 'Saved \"%s\"\\n' \"$stash_msg\"\n+\tprintf >&2 'Saved working directory and index state \"%s\"\\n' \"$stash_msg\"\n+\techo >&2 '(To restore them type \"git stash apply\")'\n }\n \n have_stash () {\n-- \n1.5.4.rc0.68.g15eb8-dirty\n"},{"id":"64001","messageId":"7vmys2ya0l.fsf@gitster.siamese.dyndns.org","threadId":"11381","inReplyTo":"1198333369-17788-1-git-send-email-win@wincent.com","subject":"Re: [PATCH] Emit helpful status for accidental \"git stash\" save","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-22T16:22:34Z","receivedAt":"2007-12-22T16:22:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wincent Colaiuta <win@wincent.com> writes:\n\n> diff --git a/git-stash.sh b/git-stash.sh\n> index f16fd9c..a2f3723 100755\n> --- a/git-stash.sh\n> +++ b/git-stash.sh\n> @@ -99,7 +99,8 @@ save_stash () {\n>  \n>  \tgit update-ref -m \"$stash_msg\" $ref_stash $w_commit ||\n>  \t\tdie \"Cannot save the current status\"\n> -\tprintf >&2 'Saved \"%s\"\\n' \"$stash_msg\"\n> +\tprintf >&2 'Saved working directory and index state \"%s\"\\n' \"$stash_msg\"\n> +\techo >&2 '(To restore them type \"git stash apply\")'\n>  }\n>  \n>  have_stash () {\n\nI like that \"To restore them...\" insn, and I like that this is\nmuch less invasive than anything we have seen during the\ndiscussion.  But can we do this only for an accidental \"git\nstash\" not for a deliberate \"git stash save\"?\n"},{"id":"64006","messageId":"1198344685-24156-1-git-send-email-win@wincent.com","threadId":"11381","inReplyTo":"7vmys2ya0l.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v2] Emit helpful status for accidental \"git stash\" save","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-22T17:31:25Z","receivedAt":"2007-12-22T17:31:25Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 22/12/2007, a las 17:22, Junio C Hamano escribiÃ³:\n\n> I like that \"To restore them...\" insn, and I like that this is\n> much less invasive than anything we have seen during the\n> discussion.  But can we do this only for an accidental \"git\n> stash\" not for a deliberate \"git stash save\"?\n\nSomething like this then?\n\n-- 8< --\nEmit helpful status for accidental \"git stash\" save\n\nIf the user types \"git stash\" mistakenly thinking that this will list\ntheir stashes he/she may be surprised to see that it actually saved\na new stash and reset their working tree and index.\n\nIn the worst case they might not know how to recover the state. So\nhelp them by telling them exactly what was saved and also how to\nrestore it immediately.\n\nSigned-off-by: Wincent Colaiuta <win@wincent.com>\n---\n git-stash.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex f16fd9c..ab52b6f 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -13,6 +13,7 @@ TMP=\"$GIT_DIR/.git-stash.$$\"\n trap 'rm -f \"$TMP-*\"' 0\n \n ref_stash=refs/stash\n+ARGC=$#\n \n no_changes () {\n \tgit diff-index --quiet --cached HEAD -- &&\n@@ -99,7 +100,9 @@ save_stash () {\n \n \tgit update-ref -m \"$stash_msg\" $ref_stash $w_commit ||\n \t\tdie \"Cannot save the current status\"\n-\tprintf >&2 'Saved \"%s\"\\n' \"$stash_msg\"\n+\tprintf >&2 'Saved working directory and index state \"%s\"\\n' \"$stash_msg\"\n+\ttest $ARGC -eq 0 &&\n+\t\techo >&2 '(To restore them type \"git stash apply\")'\n }\n \n have_stash () {\n-- \n1.5.4.rc0.68.g15eb8-dirty\n"},{"id":"64010","messageId":"7vabo2y5la.fsf@gitster.siamese.dyndns.org","threadId":"11381","inReplyTo":"1198344685-24156-1-git-send-email-win@wincent.com","subject":"Re: [PATCH v2] Emit helpful status for accidental \"git stash\" save","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-22T17:58:09Z","receivedAt":"2007-12-22T17:58:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wincent Colaiuta <win@wincent.com> writes:\n\n> El 22/12/2007, a las 17:22, Junio C Hamano escribiÃ³:\n>\n>> I like that \"To restore them...\" insn, and I like that this is\n>> much less invasive than anything we have seen during the\n>> discussion.  But can we do this only for an accidental \"git\n>> stash\" not for a deliberate \"git stash save\"?\n>\n> Something like this then?\n\nSure, even like this.\n\n git-stash.sh |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex f16fd9c..ade300c 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -99,7 +99,7 @@ save_stash () {\n \n \tgit update-ref -m \"$stash_msg\" $ref_stash $w_commit ||\n \t\tdie \"Cannot save the current status\"\n-\tprintf >&2 'Saved \"%s\"\\n' \"$stash_msg\"\n+\tprintf >&2 'Saved working directory and index state \"%s\"\\n' \"$stash_msg\"\n }\n \n have_stash () {\n@@ -228,7 +228,9 @@ create)\n *)\n \tif test $# -eq 0\n \tthen\n-\t\tsave_stash && git-reset --hard\n+\t\tsave_stash && \n+\t\techo >&2 '(To restore them type \"git stash apply\")' &&\n+\t\tgit-reset --hard\n \telse\n \t\tusage\n \tfi\n"},{"id":"64013","messageId":"E8ED8DFC-9DD9-4A5C-A344-5279CEE15458@wincent.com","threadId":"11381","inReplyTo":"7vabo2y5la.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2] Emit helpful status for accidental \"git stash\" save","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-22T18:44:15Z","receivedAt":"2007-12-22T18:44:15Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 22/12/2007, a las 18:58, Junio C Hamano escribió:\n\n> Wincent Colaiuta <win@wincent.com> writes:\n>\n>> Something like this then?\n>\n> Sure, even like this.\n>\n> git-stash.sh |    6 ++++--\n> 1 files changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-stash.sh b/git-stash.sh\n> index f16fd9c..ade300c 100755\n> --- a/git-stash.sh\n> +++ b/git-stash.sh\n> @@ -99,7 +99,7 @@ save_stash () {\n>\n> \tgit update-ref -m \"$stash_msg\" $ref_stash $w_commit ||\n> \t\tdie \"Cannot save the current status\"\n> -\tprintf >&2 'Saved \"%s\"\\n' \"$stash_msg\"\n> +\tprintf >&2 'Saved working directory and index state \"%s\"\\n'  \n> \"$stash_msg\"\n> }\n>\n> have_stash () {\n> @@ -228,7 +228,9 @@ create)\n> *)\n> \tif test $# -eq 0\n> \tthen\n> -\t\tsave_stash && git-reset --hard\n> +\t\tsave_stash &&\n> +\t\techo >&2 '(To restore them type \"git stash apply\")' &&\n> +\t\tgit-reset --hard\n> \telse\n> \t\tusage\n> \tfi\n\nPreserves the behaviour while avoiding the need for the creation of  \nthe ARGC variable, so if you prefer this solution then it seems fine  \nby me.\n\nCheers,\nWincent\n"}]}