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

Subsystems: the rest

STALE3737d

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

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

From: Björn Gustavsson <hidden>
Date: 2016-06-15 22:47:34

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 <redacted>
---
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

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

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:47:37

Bj??rn Gustavsson [off-list ref] wrote:
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 <redacted>
Acked-by: Shawn O. Pearce <redacted>
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.  :-)
 
-- 
Shawn.

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:37

"Shawn O. Pearce" [off-list ref] writes:
Bj??rn Gustavsson [off-list ref] wrote:
quoted
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 <redacted>
Acked-by: Shawn O. Pearce <redacted>
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help