Skip to contentSkip to conversation

bash: complete more options for 'git rebase'

PATCH In review Björn Gustavsson 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bash: complete more options for 'git rebase'

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

---
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(-)
contrib/completion/git-completion.bash +11 -1
index d3fec32..7c7318c 100755
@@ -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)"
Signature · 1 line
1.6.5.2.gd6127
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bj??rn Gustavsson

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

Quoted 3 lines

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.

Indeed, this would be nice. :-)

Signature · 1 line
Shawn.
#2 lore raw
Quoted 12 lines · Shawn O. Pearce
Quoted 5 lines · Bj??rn Gustavsson

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

Quoted 3 lines

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.

Thanks.