Re: [PATCH] git-stash: Display help message if git-stash is run with wrong sub-commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Kevin Leung" <kevinlsk@xxxxxxxxx> writes:

> The current git-stash behaviour is very error prone to typos. For example,
> if you typed "git-stash llist", git-stash would think that you wanted to
> save to a stash named "llist", but in fact, you meant "git-stash list".
>
> Signed-off-by: Kevin Leung <kevinlsk@xxxxxxxxx>

Thanks.  Looks good.  except...

> @@ -195,6 +195,10 @@ show)
>         shift
>         show_stash "$@"
>         ;;
> +save)
> +       shift
> +       save_stash "$@" && git-reset --hard
> +       ;;

... this should be "$*" as it was originally spelled.

Save this script in foo.sh and run "foo.sh a b c" to see what I mean.

#!/bin/sh

foo () {
	msg="$1"
	echo "Foo here <$1>"
}

foo "$@"
foo "$*"
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux