Skip to content

Commit

Permalink
Merge branch 'mk/tcsh-complete-only-known-paths'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Feb 8, 2013
2 parents d931e2f + c6929ff commit d03d820
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contrib/completion/git-completion.tcsh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d03d820

Please sign in to comment.