{"thread":{"id":"11065","subject":"[PATCH] git-stash: Display help message if git-stash is run without sub-commands","startedAt":"2007-11-30T08:16:34Z","lastAt":"2007-11-30T20:11:14Z","messageCount":7,"participants":["Kevin Leung","Mike Hommey","Wincent Colaiuta","Johannes Schindelin","Junio C Hamano","David Kastrup"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"61486","messageId":"e66701d40711300016v15700deft3d262d75a9055aca@mail.gmail.com","threadId":"11065","inReplyTo":null,"subject":"[PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"Kevin Leung","fromEmail":"kevinlsk@gmail.com","sentAt":"2007-11-30T08:16:34Z","receivedAt":"2007-11-30T08:16:34Z","isPatch":true,"sender":{"key":"kevinlsk@gmail.com","avatar":null},"body":"The current git-stash behaviour is very error prone to typos. For example,\nif you typed \"git-stash llist\", git-stash would thought that you wanted to\nsave to a stash named \"llist\", but in fact, you meant \"git-stash list\".\n\nSigned-off-by: Kevin Leung <kevinlsk@gmail.com>\n---\n git-stash.sh |   15 ++++++---------\n 1 files changed, 6 insertions(+), 9 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex 77c9421..dbb8894 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -1,7 +1,7 @@\n #!/bin/sh\n # Copyright (c) 2007, Nanako Shiraishi\n\n-USAGE='[ | list | show | apply | clear]'\n+USAGE='[ save | list | show | apply | clear ]'\n\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n@@ -195,6 +195,10 @@ show)\n        shift\n        show_stash \"$@\"\n        ;;\n+save)\n+       shift\n+       save_stash \"$@\" && git-reset --hard\n+       ;;\n apply)\n        shift\n        apply_stash \"$@\"\n@@ -202,14 +206,7 @@ apply)\n clear)\n        clear_stash\n        ;;\n-help | usage)\n-       usage\n-       ;;\n *)\n-       if test $# -gt 0 && test \"$1\" = save\n-       then\n-               shift\n-       fi\n-       save_stash \"$*\" && git-reset --hard\n+       usage\n        ;;\n esac\n-- \n1.5.3.6.36.g38762\n"},{"id":"61487","messageId":"20071130084131.GA29668@glandium.org","threadId":"11065","inReplyTo":"e66701d40711300016v15700deft3d262d75a9055aca@mail.gmail.com","subject":"Re: [PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-30T08:41:31Z","receivedAt":"2007-11-30T08:41:31Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Fri, Nov 30, 2007 at 04:16:34PM +0800, Kevin Leung <kevinlsk@gmail.com> wrote:\n> The current git-stash behaviour is very error prone to typos. For example,\n> if you typed \"git-stash llist\", git-stash would thought that you wanted to\n> save to a stash named \"llist\", but in fact, you meant \"git-stash list\".\n\nStill, 'git stash' alone should *do* the stash.\n\nMike\n"},{"id":"61488","messageId":"e66701d40711300109nc43f3efyb33e591af15a060b@mail.gmail.com","threadId":"11065","inReplyTo":"20071130084131.GA29668@glandium.org","subject":"Re: [PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"Kevin Leung","fromEmail":"kevinlsk@gmail.com","sentAt":"2007-11-30T09:09:58Z","receivedAt":"2007-11-30T09:09:58Z","isPatch":true,"sender":{"key":"kevinlsk@gmail.com","avatar":null},"body":"On Nov 30, 2007 4:41 PM, Mike Hommey <mh@glandium.org> wrote:\n> Still, 'git stash' alone should *do* the stash.\n>\n\nHow about `git stash' still does the stash, and `git stash llist'\nexits with usage message? And if you want to save the stash with name,\nyou can only do it with `git stash save name_of_stash'.\n\nKevin Leung\n"},{"id":"61489","messageId":"E1F9A2D0-F9BF-4548-8228-33A3F4984FBC@wincent.com","threadId":"11065","inReplyTo":"e66701d40711300109nc43f3efyb33e591af15a060b@mail.gmail.com","subject":"Re: [PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-11-30T09:19:09Z","receivedAt":"2007-11-30T09:19:09Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 30/11/2007, a las 10:09, Kevin Leung escribió:\n\n> On Nov 30, 2007 4:41 PM, Mike Hommey <mh@glandium.org> wrote:\n>> Still, 'git stash' alone should *do* the stash.\n>\n> How about `git stash' still does the stash, and `git stash llist'\n> exits with usage message? And if you want to save the stash with name,\n> you can only do it with `git stash save name_of_stash'.\n\nThat's probably the way it should have been all along.\n>\n\n\nCheers,\nWincent\n"},{"id":"61494","messageId":"Pine.LNX.4.64.0711301149110.27959@racer.site","threadId":"11065","inReplyTo":"e66701d40711300016v15700deft3d262d75a9055aca@mail.gmail.com","subject":"Re: [PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-30T11:50:20Z","receivedAt":"2007-11-30T11:50:20Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 30 Nov 2007, Kevin Leung wrote:\n\n> The current git-stash behaviour is very error prone to typos. For \n> example, if you typed \"git-stash llist\", git-stash would thought that \n> you wanted to save to a stash named \"llist\", but in fact, you meant \n> \"git-stash list\".\n\nI am fine with your patch.  I would be equally fine with \"git stash\" still \nchoosing a default message and stashing.\n\nAnd yes, I agree that the \"git stash <whatever>\" might be a little too \nerror-prone.\n\nCiao,\nDscho\n"},{"id":"61522","messageId":"7vr6i7qz6b.fsf@gitster.siamese.dyndns.org","threadId":"11065","inReplyTo":"e66701d40711300109nc43f3efyb33e591af15a060b@mail.gmail.com","subject":"Re: [PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-30T20:02:52Z","receivedAt":"2007-11-30T20:02:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kevin Leung\" <kevinlsk@gmail.com> writes:\n\n> On Nov 30, 2007 4:41 PM, Mike Hommey <mh@glandium.org> wrote:\n>> Still, 'git stash' alone should *do* the stash.\n>>\n>\n> How about `git stash' still does the stash, and `git stash llist'\n> exits with usage message? And if you want to save the stash with name,\n> you can only do it with `git stash save name_of_stash'.\n\nSounds like a sensible thing to do.\n"},{"id":"61523","messageId":"85mysvwl25.fsf@lola.goethe.zz","threadId":"11065","inReplyTo":"7vr6i7qz6b.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-stash: Display help message if git-stash is run without sub-commands","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-11-30T20:11:14Z","receivedAt":"2007-11-30T20:11:14Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Kevin Leung\" <kevinlsk@gmail.com> writes:\n>\n>> On Nov 30, 2007 4:41 PM, Mike Hommey <mh@glandium.org> wrote:\n>>> Still, 'git stash' alone should *do* the stash.\n>>>\n>>\n>> How about `git stash' still does the stash, and `git stash llist'\n>> exits with usage message? And if you want to save the stash with name,\n>> you can only do it with `git stash save name_of_stash'.\n>\n> Sounds like a sensible thing to do.\n\nInstead of \"save\", one could use \"stash\" since that is what it is\nsupposed to do.  Then\n\ngit stash stash stash\n\nwould create a stash called \"stash\".\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"}]}