{"thread":{"id":"47288","subject":"stash: learn to parse -m/--message like commit does","startedAt":"2017-11-21T23:07:51Z","lastAt":"2017-11-21T23:22:07Z","messageCount":3,"participants":["Phil Hord","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"333185","messageId":"CABURp0qadq2cAwR_Nk76J8RqpQk4DZwtnu6aS5hR=LjVD-dGgA@mail.gmail.com","threadId":"47288","inReplyTo":null,"subject":"stash: learn to parse -m/--message like commit does","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2017-11-21T23:07:24Z","receivedAt":"2017-11-21T23:07:51Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"`git stash push -m foo` uses \"foo\" as the message for the stash. But\n`git stash push -m\"foo\"` does not parse successfully.  Similarly\n`git stash push --message=\"My stash message\"` also fails.  Nothing\nin the documentation suggests this syntax should work, but it does\nwork for `git commit`, and my fingers have learned this pattern long\nago.\n\nTeach `git stash` to parse -mFoo and --message=Foo the same as\n`git commit` would do.\n\nSigned-off-by: Phil Hord <phil.hord@gmail.com>\n---\n git-stash.sh | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex 4b7495144..1114005ce 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -76,6 +76,12 @@ create_stash () {\n  shift\n  stash_msg=${1?\"BUG: create_stash () -m requires an argument\"}\n  ;;\n+ -m*)\n+ stash_msg=${1#-m}\n+ ;;\n+ --message=*)\n+ stash_msg=${1#--message=}\n+ ;;\n  -u|--include-untracked)\n  shift\n  untracked=${1?\"BUG: create_stash () -u requires an argument\"}\n@@ -193,6 +199,12 @@ store_stash () {\n  shift\n  stash_msg=\"$1\"\n  ;;\n+ -m*)\n+ stash_msg=${1#-m}\n+ ;;\n+ --message=*)\n+ stash_msg=${1#--message=}\n+ ;;\n  -q|--quiet)\n  quiet=t\n  ;;\n@@ -251,6 +263,12 @@ push_stash () {\n  test -z ${1+x} && usage\n  stash_msg=$1\n  ;;\n+ -m*)\n+ stash_msg=${1#-m}\n+ ;;\n+ --message=*)\n+ stash_msg=${1#--message=}\n+ ;;\n  --help)\n  show_help\n  ;;\n-- \n2.15.0.471.g17a719cfe.dirty\n"},{"id":"333186","messageId":"CABURp0p71fdytYqj3nhhij1APdEY-inmTMbQ8aiF-J-hKd-c0w@mail.gmail.com","threadId":"47288","inReplyTo":"CABURp0qadq2cAwR_Nk76J8RqpQk4DZwtnu6aS5hR=LjVD-dGgA@mail.gmail.com","subject":"Re: stash: learn to parse -m/--message like commit does","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2017-11-21T23:09:48Z","receivedAt":"2017-11-21T23:10:14Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"Hm..  Sorry about the formatting here.  It's been a while.  I'll try again.\n\nOn Tue, Nov 21, 2017 at 3:07 PM, Phil Hord <phil.hord@gmail.com> wrote:\n> `git stash push -m foo` uses \"foo\" as the message for the stash. But\n> `git stash push -m\"foo\"` does not parse successfully.  Similarly\n> `git stash push --message=\"My stash message\"` also fails.  Nothing\n> in the documentation suggests this syntax should work, but it does\n> work for `git commit`, and my fingers have learned this pattern long\n> ago.\n>\n> Teach `git stash` to parse -mFoo and --message=Foo the same as\n> `git commit` would do.\n>\n> Signed-off-by: Phil Hord <phil.hord@gmail.com>\n> ---\n>  git-stash.sh | 18 ++++++++++++++++++\n>  1 file changed, 18 insertions(+)\n>\n> diff --git a/git-stash.sh b/git-stash.sh\n> index 4b7495144..1114005ce 100755\n> --- a/git-stash.sh\n> +++ b/git-stash.sh\n> @@ -76,6 +76,12 @@ create_stash () {\n>   shift\n>   stash_msg=${1?\"BUG: create_stash () -m requires an argument\"}\n>   ;;\n> + -m*)\n> + stash_msg=${1#-m}\n> + ;;\n> + --message=*)\n> + stash_msg=${1#--message=}\n> + ;;\n>   -u|--include-untracked)\n>   shift\n>   untracked=${1?\"BUG: create_stash () -u requires an argument\"}\n> @@ -193,6 +199,12 @@ store_stash () {\n>   shift\n>   stash_msg=\"$1\"\n>   ;;\n> + -m*)\n> + stash_msg=${1#-m}\n> + ;;\n> + --message=*)\n> + stash_msg=${1#--message=}\n> + ;;\n>   -q|--quiet)\n>   quiet=t\n>   ;;\n> @@ -251,6 +263,12 @@ push_stash () {\n>   test -z ${1+x} && usage\n>   stash_msg=$1\n>   ;;\n> + -m*)\n> + stash_msg=${1#-m}\n> + ;;\n> + --message=*)\n> + stash_msg=${1#--message=}\n> + ;;\n>   --help)\n>   show_help\n>   ;;\n> --\n> 2.15.0.471.g17a719cfe.dirty\n"},{"id":"333189","messageId":"20171121232200.GL3429@aiede.mtv.corp.google.com","threadId":"47288","inReplyTo":"CABURp0qadq2cAwR_Nk76J8RqpQk4DZwtnu6aS5hR=LjVD-dGgA@mail.gmail.com","subject":"Re: stash: learn to parse -m/--message like commit does","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-11-21T23:22:00Z","receivedAt":"2017-11-21T23:22:07Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nPhil Hord wrote:\n\n> `git stash push -m foo` uses \"foo\" as the message for the stash. But\n> `git stash push -m\"foo\"` does not parse successfully.  Similarly\n> `git stash push --message=\"My stash message\"` also fails.  Nothing\n> in the documentation suggests this syntax should work,\n\n\"git help cli\" says it should work.  Thanks for working on it.\n\n>                                                        but it does\n> work for `git commit`, and my fingers have learned this pattern long\n> ago.\n"}]}