Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 3/3] _git: Complete --contains after -r (--remotes).

This one I'm not so sure about.  I wanted to make «git branch -r --cont<TAB>»
complete the option name and arguments to it, and that part works, but
the way in which those single-letter variable names are used in the
_arguments specs is pretty undecipherable.  Does this patch seem
obviously right, or obviously wrong, to anyone?  If not, I'll test it
for a while and commit it to the 5.9 branch if I don't find any obvious
showstopper.  (But I don't use «git branch» that frequently, so perhaps
it'll be better if I committed this to 5.9 directly…?)



 Completion/Unix/Command/_git | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8e0d57789..d503b1134 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -282,9 +282,13 @@ _git-bisect () {
 _git-branch () {
   declare l c m d e
+  # listing branches
-  l='--color --no-color -r --remotes -a -v --verbose --abbrev --no-abbrev -l --list --points-at --sort'
+  l='--color --no-color -r --remotes -a -v --verbose --abbrev --no-abbrev -l --list --points-at --sort --contains --no-contains'
+  # creating branches
-  c='--create-reflog -f --force -t --track --no-track -u --set-upstream --set-upstream-to --unset-upstream --contains --no-contains --merged --no-merged'
+  c='--create-reflog -f --force -t --track --no-track -u --set-upstream --set-upstream-to --unset-upstream --merged --no-merged'
+  # modifying branches
   m='-c --copy -C -m --move -M --edit-description --show-current'
+  # deleting branches
   d='-d --delete -D'
   declare -a dependent_creation_args

Messages sorted by: Reverse Date, Date, Thread, Author