git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kevin Leung" <kevinlsk@gmail.com>
To: "Git ML" <git@vger.kernel.org>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Nanako Shiraishi" <nanako3@bluebottle.com>
Subject: [PATCH] git-stash: Display help message if git-stash is run without sub-commands
Date: Fri, 30 Nov 2007 16:16:34 +0800	[thread overview]
Message-ID: <e66701d40711300016v15700deft3d262d75a9055aca@mail.gmail.com> (raw)

The current git-stash behaviour is very error prone to typos. For example,
if you typed "git-stash llist", git-stash would thought that you wanted to
save to a stash named "llist", but in fact, you meant "git-stash list".

Signed-off-by: Kevin Leung <kevinlsk@gmail.com>
---
 git-stash.sh |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index 77c9421..dbb8894 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright (c) 2007, Nanako Shiraishi

-USAGE='[ | list | show | apply | clear]'
+USAGE='[ save | list | show | apply | clear ]'

 SUBDIRECTORY_OK=Yes
 . git-sh-setup
@@ -195,6 +195,10 @@ show)
        shift
        show_stash "$@"
        ;;
+save)
+       shift
+       save_stash "$@" && git-reset --hard
+       ;;
 apply)
        shift
        apply_stash "$@"
@@ -202,14 +206,7 @@ apply)
 clear)
        clear_stash
        ;;
-help | usage)
-       usage
-       ;;
 *)
-       if test $# -gt 0 && test "$1" = save
-       then
-               shift
-       fi
-       save_stash "$*" && git-reset --hard
+       usage
        ;;
 esac
-- 
1.5.3.6.36.g38762

             reply	other threads:[~2007-11-30  8:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30  8:16 Kevin Leung [this message]
2007-11-30  8:41 ` [PATCH] git-stash: Display help message if git-stash is run without sub-commands Mike Hommey
2007-11-30  9:09   ` Kevin Leung
2007-11-30  9:19     ` Wincent Colaiuta
2007-11-30 20:02     ` Junio C Hamano
2007-11-30 20:11       ` David Kastrup
2007-11-30 11:50 ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e66701d40711300016v15700deft3d262d75a9055aca@mail.gmail.com \
    --to=kevinlsk@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nanako3@bluebottle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).