about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-03-09 14:06:49 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-03-09 14:08:49 +0000
commit33bd9136d6700dcef772a48dc565fe11a7dfb85a (patch)
tree93c2eb1c7eb6df098c9797e8449bf1d2b6575e21
parentf4dfca490cb6d4b4fc7c6b977db56ab0d718de21 (diff)
downloadzsh-33bd9136d6700dcef772a48dc565fe11a7dfb85a.tar.gz
zsh-33bd9136d6700dcef772a48dc565fe11a7dfb85a.tar.xz
zsh-33bd9136d6700dcef772a48dc565fe11a7dfb85a.zip
38120: _git: Document the internal helper function __git_ignore_line.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git10
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index be61bd073..b99eee7c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-09  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 38120: Completion/Unix/Command/_git: Document the internal
+	helper function __git_ignore_line.
+
 2016-03-08  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 38114: Src/exec.c: In substitutions involving subshells, disable
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 7a459f1fb..2dd9a8028 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5038,6 +5038,16 @@ __git_describe_commit () {
 
 # Completion Wrappers
 
+# '__git_ignore_line $callee "${callee_args[@]}" "${callee_compadd_args[@]}"'
+# invokes '$callee "${callee_args[@]}" "${callee_compadd_args[@]}"' with
+# callee_compadd_args modified to exclude positional parameters to the completed
+# command from being completed.  This causes 'git add foo <TAB>' not to offer
+# 'foo' again.
+#
+# Note: This function can't be used to wrap bare 'compadd' calls that use a '--'
+# argument terminator.  It can wrap functions of the form
+#     f() { shift $N; compadd "$@" -a - mymatches }
+# .
 (( $+functions[__git_ignore_line] )) ||
 __git_ignore_line () {
   declare -a ignored