Thread (12 messages) flat view 12 messages, 5 authors, 9h ago
HOTtoday

Revision v3 of 2 in this series.

Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH v3 4/4] completion: complete 'git history split' pathspecs

From: Vincent Mailhol <mailhol@kernel.org>
Date: 2026-08-13 19:05:34
Subsystem: the rest · Maintainer: Linus Torvalds

Arguments following the required revision of "git history split" are
pathspecs. Complete them from tracked paths, including after an explicit
"--".

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
Changes in v3:

  - No changes.

Changes in v2:

  - New patch.
---
 contrib/completion/git-completion.bash |  6 ++++++
 t/t9902-completion.sh                  | 13 +++++++++++++
 2 files changed, 19 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 19600940dc..6172b6182f 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2194,6 +2194,12 @@ _git_history ()
 		__git_complete_refs
 		return
 	fi
+
+	case "$subcommand" in
+	split)
+		__git_complete_index_file "--cached"
+		;;
+	esac
 }
 
 _git_init ()
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index b225dd3800..194bca8d6c 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -3144,6 +3144,19 @@ test_expect_success 'git history revisions' '
 	test_completion "git history reword main m" ""
 '
 
+test_expect_success 'git history split pathspecs' '
+	test_completion "git history split main -- --update-refs=h" "" &&
+	test_completion "git history split main -- --update-refs h" "" &&
+	test_completion "git history split --dry-run main file" <<-\EOF &&
+	file1Z
+	file2Z
+	EOF
+	test_completion "git history split main -- file" <<-\EOF
+	file1Z
+	file2Z
+	EOF
+'
+
 test_expect_success 'git reflog show' '
 	test_when_finished "git checkout - && git branch -d shown" &&
 	git checkout -b shown &&
-- 
2.54.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help