threads / rfc / 45275

RFC patch, 2 partscompletion: add bash completion for 'filter-branch'

Subject: [RFC PATCH 2/2] completion: add bash completion for 'filter-branch'

## tl;dr

One message between Mar 3, 2017 and Mar 3, 2017. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Denton Liu· Mar 3, 2017, 12:35 UTC · lore
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
If the last patch (PATCH 1/2) is not included, we can remove the call to
__git_complete_rev_list_command.
---
 contrib/completion/git-completion.bash | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
Show changes to contrib/completion/git-completion.bash +17 −0
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 412485369..933dac78b 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1307,6 +1307,23 @@ _git_fetch ()
 	__git_complete_remote_or_refspec
 }
 
+__git_filter_branch_options="
+	--env-filter --tree-filter --index-filter --parent-filter --msg-filter
+	--commit-filter --tag-name-filter --subdirectory-filter --prune-empty
+	--original --force
+"
+_git_filter_branch ()
+{
+	__git_has_doubledash && __git_complete_rev_list_command && return
+
+	case "$cur" in
+	--*)
+		__gitcomp "$__git_filter_branch_options"
+		return
+		;;
+	esac
+}
+
 __git_format_patch_options="
 	--stdout --attach --no-attach --thread --thread= --no-thread
 	--numbered --start-number --numbered-files --keep-subject --signoff
-- 
2.12.0.1.g5415fdfc5.dirty

← back to recent threads