threads / patch / 66905

patchcompletion: add blob:none etc after git clone --filter=

Subject: [PATCH] completion: add blob:none etc after git clone --filter=

## tl;dr

One message between Nov 21, 2026 and Nov 21, 2026. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

A4-Tacks via GitGitGadget· Nov 21, 2026, 12:54 UTC · lore
From: A4-Tacks <wdsjxhno1001@163.com>

Git clone and fetch both have similar --filter arg, but currently cannot complete after --filter= in clone.

So add completions similar to git fetch --filter=
Signed-off-by: A4-Tacks <wdsjxhno1001@163.com>
---
    completion: add blob:none etc after git clone --filter=
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2481%2FA4-Tacks%2Fcomplete-filter-clone-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2481/A4-Tacks/complete-filter-clone-v1
Pull-Request: https://github.com/git/git/pull/2481
 contrib/completion/git-completion.bash | 4 ++++
 1 file changed, 4 insertions(+)
Show changes to contrib/completion/git-completion.bash +4 −0
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9cd9c7cadb..f8f7f40a94 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1841,6 +1841,10 @@ _git_clone ()
 			--cur="${cur##--config=}"
 		return
 		;;
+	--filter=*)
+		__gitcomp "blob:none blob:limit= sparse:oid=" "" "${cur##--filter=}"
+		return
+		;;
 	--*)
 		__gitcomp_builtin clone
 		return

base-commit: 0ffa3e35c7c82ab8d0de226149fb03b3f7674d05
-- 
gitgitgadget

← back to recent threads