{"thread":{"id":"47289","subject":"[PATCH] stash: Learn to parse -m/--message like commit does","startedAt":"2017-11-21T23:27:35Z","lastAt":"2017-11-22T04:44:48Z","messageCount":3,"participants":["Phil Hord","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"333190","messageId":"20171121232643.8380-1-phil.hord@gmail.com","threadId":"47289","inReplyTo":null,"subject":"[PATCH] stash: Learn to parse -m/--message like commit does","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2017-11-21T23:26:42Z","receivedAt":"2017-11-21T23:27:35Z","isPatch":true,"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 \t\t\tshift\n \t\t\tstash_msg=${1?\"BUG: create_stash () -m requires an argument\"}\n \t\t\t;;\n+\t\t-m*)\n+\t\t\tstash_msg=${1#-m}\n+\t\t\t;;\n+\t\t--message=*)\n+\t\t\tstash_msg=${1#--message=}\n+\t\t\t;;\n \t\t-u|--include-untracked)\n \t\t\tshift\n \t\t\tuntracked=${1?\"BUG: create_stash () -u requires an argument\"}\n@@ -193,6 +199,12 @@ store_stash () {\n \t\t\tshift\n \t\t\tstash_msg=\"$1\"\n \t\t\t;;\n+\t\t-m*)\n+\t\t\tstash_msg=${1#-m}\n+\t\t\t;;\n+\t\t--message=*)\n+\t\t\tstash_msg=${1#--message=}\n+\t\t\t;;\n \t\t-q|--quiet)\n \t\t\tquiet=t\n \t\t\t;;\n@@ -251,6 +263,12 @@ push_stash () {\n \t\t\ttest -z ${1+x} && usage\n \t\t\tstash_msg=$1\n \t\t\t;;\n+\t\t-m*)\n+\t\t\tstash_msg=${1#-m}\n+\t\t\t;;\n+\t\t--message=*)\n+\t\t\tstash_msg=${1#--message=}\n+\t\t\t;;\n \t\t--help)\n \t\t\tshow_help\n \t\t\t;;\n-- \n2.15.0.471.g17a719cfe.dirty\n\n"},{"id":"333191","messageId":"20171121232643.8380-2-phil.hord@gmail.com","threadId":"47289","inReplyTo":"20171121232643.8380-1-phil.hord@gmail.com","subject":"[PATCH] doc: prefer 'stash push' instead of 'stash save'","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2017-11-21T23:26:43Z","receivedAt":"2017-11-21T23:27:50Z","isPatch":true,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"Although `git stash save` was deprecated recently, some parts of the\ndocumentation still refer to it.\n\nSigned-off-by: Phil Hord <phil.hord@gmail.com>\n---\n Documentation/git-stash.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 8be661007..056dfb866 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -175,14 +175,14 @@ create::\n \treturn its object name, without storing it anywhere in the ref\n \tnamespace.\n \tThis is intended to be useful for scripts.  It is probably not\n-\tthe command you want to use; see \"save\" above.\n+\tthe command you want to use; see \"push\" above.\n \n store::\n \n \tStore a given stash created via 'git stash create' (which is a\n \tdangling merge commit) in the stash ref, updating the stash\n \treflog.  This is intended to be useful for scripts.  It is\n-\tprobably not the command you want to use; see \"save\" above.\n+\tprobably not the command you want to use; see \"push\" above.\n \n DISCUSSION\n ----------\n-- \n2.15.0.471.g17a719cfe.dirty\n\n"},{"id":"333240","messageId":"xmqqh8tmvs5j.fsf@gitster.mtv.corp.google.com","threadId":"47289","inReplyTo":"20171121232643.8380-1-phil.hord@gmail.com","subject":"Re: [PATCH] stash: Learn to parse -m/--message like commit does","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-22T04:44:40Z","receivedAt":"2017-11-22T04:44:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phil Hord <phil.hord@gmail.com> writes:\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, 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\nMakes sense.  Thanks.\n\nI wonder if you want to add a trivial test or two for this, if \"git\nstash [save|push|nothing] -m foo\" is already tested.  It appears\nthat t3903 already has a test that does 'push -m \"test message\"' and\nsees if that appears in the output of \"list\", which looks like the\nideal place to do so.\n\n"}]}