Skip to contentSkip to conversation

stash: fix USAGE text

PATCH In review Marc Strapetz 2 participants 3 messages Jan 3, 2017 – Jan 9, 2017 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 stash: fix USAGE text

Add missing usage description for stash subcommands 'create' and 'store'.

---
 git-stash.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
git-stash.sh +3 -1
index 10c284d1a..c6b9db694 100755
@@ -9,7 +9,9 @@ USAGE="list [<options>]
    or: $dashless branch <branchname> [<stash>]
    or: $dashless [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
 		       [-u|--include-untracked] [-a|--all] [<message>]]
-   or: $dashless clear"
+   or: $dashless clear
+   or: $dashless create [<message>]
+   or: $dashless store [-m|--message <message>] [-q|--quiet] <commit>"
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 stash: --[no-]include-untracked option for create

Expose internal option to include untracked files
for the stash 'create' subcommand.

---
 Documentation/git-stash.txt |  2 +-
 git-stash.sh                | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
Documentation/git-stash.txt +1 -1
index 2e9cef06e..cc7944e59 100644
@@ -16,7 +16,7 @@ SYNOPSIS
 'git stash' [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
 	     [-u|--include-untracked] [-a|--all] [<message>]]
 'git stash' clear
-'git stash' create [<message>]
+'git stash' create [-u|--[no-]include-untracked] [<message>]
 'git stash' store [-m|--message <message>] [-q|--quiet] <commit>
 
 DESCRIPTION
git-stash.sh +12 -2
index c6b9db694..16f5fe93e 100755
@@ -10,7 +10,7 @@ USAGE="list [<options>]
    or: $dashless [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
 		       [-u|--include-untracked] [-a|--all] [<message>]]
    or: $dashless clear
-   or: $dashless create [<message>]
+   or: $dashless create [-u|--[no-]include-untracked] [<message>]
    or: $dashless store [-m|--message <message>] [-q|--quiet] <commit>"
 
 SUBDIRECTORY_OK=Yes
@@ -629,7 +629,17 @@ clear)
 	;;
 create)
 	shift
-	create_stash "$*" && echo "$w_commit"
+	case "$1" in
+	-u|--include-untracked)
+		untracked=untracked
+		shift
+		;;
+	--no-include-untracked)
+		untracked=
+		shift
+		;;
+	esac
+	create_stash "$*" "$untracked" && echo "$w_commit"
 	;;
 store)
 	shift
Signature · 1 line
2.11.0
#2 lore raw
In reply to Marc Strapetz
Quoted 2 lines · Marc Strapetz

Add missing usage description for stash subcommands 'create' and 'store'.

I think we didn't add them to usage description when we added them because these two are not end-user facing commands but for script writers (who do not use "$ git stash -h <ENTER>" to learn how to use).

I dunno.

Quoted 20 lines
---
 git-stash.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
git-stash.sh +3 -1
index 10c284d1a..c6b9db694 100755
@@ -9,7 +9,9 @@ USAGE="list [<options>]
    or: $dashless branch <branchname> [<stash>]
    or: $dashless [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
 		       [-u|--include-untracked] [-a|--all] [<message>]]
-   or: $dashless clear"
+   or: $dashless clear
+   or: $dashless create [<message>]
+   or: $dashless store [-m|--message <message>] [-q|--quiet] <commit>"
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=