{"thread":{"id":"15032","subject":"[PATCH] git-stash: improve synopsis in help and manual page","startedAt":"2008-08-16T03:27:31Z","lastAt":"2008-08-16T09:49:06Z","messageCount":2,"participants":["Stephan Beyer","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"87363","messageId":"1218857251-2971-1-git-send-email-s-beyer@gmx.net","threadId":"15032","inReplyTo":null,"subject":"[PATCH] git-stash: improve synopsis in help and manual page","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-08-16T03:27:31Z","receivedAt":"2008-08-16T03:27:31Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"\"git stash -h\" showed some incomplete and ugly usage information.\nFor example, the useful \"--keep-index\" option for \"save\" or the \"--index\"\noption for  \"apply\" were not shown. Also in the documentation synopsis they\nwere not shown, so that there is no incentive to scroll down and even see\nthat such options exist.\n\nThis patch improves the git-stash synopsis in the documentation by\nmentioning that further options to the stash commands and then copies\nthis synopsis to the usage information string of git-stash.sh.\n\nFor the latter, the dashless git command string has to be inserted on the\nsecond and the following usage lines. The code of this is taken from\ngit-sh-setup so that all lines will show the command string.\n\nNote that the \"create\" command is not advertised at all now, because\nit was not mentioned in git-stash.txt.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n   Hi,\n\n   btw, should the \"create\" command be used directly at all?\n   Then a line for this should perhaps be added.\n\n   Regards,\n     Stephan\n\n   PS: This or something like this is meant to go into 1.6.0,\n       so I hope this is not too late :-)\n\n Documentation/git-stash.txt |    7 ++++---\n git-stash.sh                |    8 +++++++-\n 2 files changed, 11 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 7d50d74..4dd42b4 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -8,10 +8,11 @@ git-stash - Stash the changes in a dirty working directory away\n SYNOPSIS\n --------\n [verse]\n-'git stash' list\n-'git stash' (show | apply | drop | pop ) [<stash>]\n+'git stash' list [<options>]\n+'git stash' (show | drop | pop ) [<stash>]\n+'git stash' [--index] apply [<stash>]\n 'git stash' branch <branchname> [<stash>]\n-'git stash' [save [<message>]]\n+'git stash' [--keep-index] [save [<message>]]\n 'git stash' clear\n \n DESCRIPTION\ndiff --git a/git-stash.sh b/git-stash.sh\nindex 5ad2c4b..d790676 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -1,7 +1,13 @@\n #!/bin/sh\n # Copyright (c) 2007, Nanako Shiraishi\n \n-USAGE='[  | save | list | show | apply | clear | drop | pop | create | branch ]'\n+dashless=$(basename \"$0\" | sed -e 's/-/ /')\n+USAGE=\"list [<options>]\n+   or: $dashless (show | drop | pop ) [<stash>]\n+   or: $dashless [--index] apply [<stash>]\n+   or: $dashless branch <branchname> [<stash>]\n+   or: $dashless [--keep-index] [save [<message>]]\n+   or: $dashless clear\"\n \n SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n-- \n1.6.0.rc3.10.g5a13c.dirty\n"},{"id":"87371","messageId":"7vljyxe1d9.fsf@gitster.siamese.dyndns.org","threadId":"15032","inReplyTo":"1218857251-2971-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH] git-stash: improve synopsis in help and manual page","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-16T09:49:06Z","receivedAt":"2008-08-16T09:49:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n>    btw, should the \"create\" command be used directly at all?\n>    Then a line for this should perhaps be added.\n\nIt's pretty much for Porcelain writer's consumption, so I do not think\nit is worth adding it to command line help, even though it would be nice\nto describe it in the documentation.\n\n> +dashless=$(basename \"$0\" | sed -e 's/-/ /')\n> +USAGE=\"list [<options>]\n> +   or: $dashless (show | drop | pop ) [<stash>]\n> +   or: $dashless [--index] apply [<stash>]\n> +   or: $dashless branch <branchname> [<stash>]\n> +   or: $dashless [--keep-index] [save [<message>]]\n> +   or: $dashless clear\"\n\nThese --index and --keep-index are subcommand options and come after\nthem (i.e. apply/save).\n"}]}