summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d768f7)
raw | patch | inline | side by side (parent: 0d768f7)
author | Stephan Beyer <s-beyer@gmx.net> | |
Sat, 16 Aug 2008 03:27:31 +0000 (05:27 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 16 Aug 2008 09:58:18 +0000 (02:58 -0700) |
"git stash -h" showed some incomplete and ugly usage information.
For example, the useful "--keep-index" option for "save" or the "--index"
option for "apply" were not shown. Also in the documentation synopsis they
were not shown, so that there is no incentive to scroll down and even see
that such options exist.
This patch improves the git-stash synopsis in the documentation by
mentioning that further options to the stash commands and then copies
this synopsis to the usage information string of git-stash.sh.
For the latter, the dashless git command string has to be inserted on the
second and the following usage lines. The code of this is taken from
git-sh-setup so that all lines will show the command string.
Note that the "create" command is not advertised at all now, because
it was not mentioned in git-stash.txt.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
For example, the useful "--keep-index" option for "save" or the "--index"
option for "apply" were not shown. Also in the documentation synopsis they
were not shown, so that there is no incentive to scroll down and even see
that such options exist.
This patch improves the git-stash synopsis in the documentation by
mentioning that further options to the stash commands and then copies
this synopsis to the usage information string of git-stash.sh.
For the latter, the dashless git command string has to be inserted on the
second and the following usage lines. The code of this is taken from
git-sh-setup so that all lines will show the command string.
Note that the "create" command is not advertised at all now, because
it was not mentioned in git-stash.txt.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-stash.txt | patch | blob | history | |
git-stash.sh | patch | blob | history |
index 7d50d74cc9a945f0dd82b0c26509bf0392eff837..49e2296a24825b2ea3a0976ff9073e7b44e976d8 100644 (file)
SYNOPSIS
--------
[verse]
-'git stash' list
-'git stash' (show | apply | drop | pop ) [<stash>]
+'git stash' list [<options>]
+'git stash' (show | drop | pop ) [<stash>]
+'git stash' apply [--index] [<stash>]
'git stash' branch <branchname> [<stash>]
-'git stash' [save [<message>]]
+'git stash' [save [--keep-index] [<message>]]
'git stash' clear
+'git stash' create
DESCRIPTION
-----------
of the current working tree state. When no `<stash>` is given,
`stash@\{0}` is assumed. See also `apply`.
+create::
+
+ Create a stash (which is a regular commit object) and return its
+ object name, without storing it anywhere in the ref namespace.
+
DISCUSSION
----------
diff --git a/git-stash.sh b/git-stash.sh
index 5ad2c4b7a33cf1be24ee85f17c8738ca05b98db0..e15c12abc31c1e4d22bb3943d70a65ddf33abb53 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
-USAGE='[ | save | list | show | apply | clear | drop | pop | create | branch ]'
+dashless=$(basename "$0" | sed -e 's/-/ /')
+USAGE="list [<options>]
+ or: $dashless (show | drop | pop ) [<stash>]
+ or: $dashless apply [--index] [<stash>]
+ or: $dashless branch <branchname> [<stash>]
+ or: $dashless [save [--keep-index] [<message>]]
+ or: $dashless clear"
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=