git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] bash: add 'git stash apply --index' option

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Mar 14, 2008, 11:15 UTC
Message-ID
<1205493313-4717-1-git-send-email-szeder@ira.uka.de>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 5046f69..2265757 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1126,8 +1126,19 @@ _git_show ()
 _git_stash ()
 {
 	local subcommands='save list show apply clear drop pop create'
-	if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
+	local subcommand="$(__git_find_subcommand "$subcommands")"
+	if [ -z "$subcommand" ]; then
 		__gitcomp "$subcommands"
+	else
+		local cur="${COMP_WORDS[COMP_CWORD]}"
+		case "$subcommand,$cur" in
+		apply,--*)
+			__gitcomp "--index"
+			;;
+		*)
+			COMPREPLY=()
+			;;
+		esac
 	fi
 }
 
-- 
1.5.4.4.532.ga6828
Next: SZEDER Gábor
Message 1 of 2 in “bash: add 'git stash apply --index' option”
  1. bash: add 'git stash apply --index' optionSZEDER Gábor, Mar 14, 2008
  2. bash: removed unnecessary checks for long options with argumentSZEDER Gábor, Mar 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.