aboutsummaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-08 15:28:51 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-08 15:28:51 -0800
commitd03d820a8c4b1eada9528e95baf9f39607034b97 (patch)
tree2e8a0ea77bdbb0e9ec9bd9c6d2ab17a71b0e0479 /contrib/completion
parentd931e2fb252ed2dc4ecdbc24683000da1ec8e989 (diff)
parentc6929ff239e2bd94fc52f6a3c4db3d5c5c5b0e8d (diff)
downloadgit-d03d820a8c4b1eada9528e95baf9f39607034b97.tar.gz
git-d03d820a8c4b1eada9528e95baf9f39607034b97.tar.xz
Merge branch 'mk/tcsh-complete-only-known-paths'
The "complete with known paths only" update to completion scripts returns directory names without trailing slash to compensate the addition of '/' done by bash that reads from our completion result. tcsh completion code that reads from our internal completion result does not add '/', so let it ask our complletion code to keep the '/' at the end. * mk/tcsh-complete-only-known-paths: completion: handle path completion and colon for tcsh script
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.tcsh12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.tcsh b/contrib/completion/git-completion.tcsh
index 3e3889f2b..eaacaf0c3 100644
--- a/contrib/completion/git-completion.tcsh
+++ b/contrib/completion/git-completion.tcsh
@@ -52,6 +52,18 @@ cat << EOF > ${__git_tcsh_completion_script}
source ${__git_tcsh_completion_original_script}
+# Remove the colon as a completion separator because tcsh cannot handle it
+COMP_WORDBREAKS=\${COMP_WORDBREAKS//:}
+
+# For file completion, tcsh needs the '/' to be appended to directories.
+# By default, the bash script does not do that.
+# We can achieve this by using the below compatibility
+# method of the git-completion.bash script.
+__git_index_file_list_filter ()
+{
+ __git_index_file_list_filter_compat
+}
+
# Set COMP_WORDS in a way that can be handled by the bash script.
COMP_WORDS=(\$2)