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

[PATCH] bash: complete more options for 'git rebase'

From
Björn Gustavsson <bgustavsson@gmail.com>
Date
Oct 17, 2009, 09:33 UTC
Message-ID
<4AD98F72.1060901@gmail.com>

Complete all long options for 'git rebase' except --no-verify (probably used very seldom) and the long options corresponding to -v, -q, and -f.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
---
I am primarily interested in having the --whitespace= option completed,
but while at it I have added completion for the other potentially useful
long options.
 contrib/completion/git-completion.bash |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d3fec32..7c7318c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1323,8 +1323,18 @@ _git_rebase ()
 	fi
 	__git_complete_strategy && return
 	case "$cur" in
+	--whitespace=*)
+		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
+		return
+		;;
 	--*)
-		__gitcomp "--onto --merge --strategy --interactive"
+		__gitcomp "
+			--onto --merge --strategy --interactive
+			--preserve-merges --stat --no-stat
+			--committer-date-is-author-date --ignore-date
+			--ignore-whitespace --whitespace=
+			"
+
 		return
 	esac
 	__gitcomp "$(__git_refs)"
-- 
1.6.5.2.gd6127
Next: Shawn O. Pearce
Message 1 of 3 in “bash: complete more options for 'git rebase'”
  1. bash: complete more options for 'git rebase'Björn Gustavsson, Oct 17, 2009
  2. Shawn O. PearceOct 28, 2009
  3. Junio C HamanoOct 28, 2009

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.