autocompletion for 'git submodule' commands is broken

Bug #1317154 reported by Phil Hord
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zsh (Ubuntu)
Fix Committed
Undecided
Unassigned

Bug Description

Autocompletion in bash for subomdules works by completing simple file paths.

    $ git clone https://gerrit.googlesource.com/gerrit && cd gerrit
    $ git submodule init plugins/<TAB><TAB>
    commit-message-length-validator/ README reviewnotes/
    helloworld/ replication/

In zsh the completion tries to be clever and list the submodule names only. But it collects too much information and tries to complete submodule name + commit description. So, I expect this:

    % git submodule init plugins/<TAB>
    plugins/commit-message-length-validator plugins/reviewnotes
    plugins/replication

Instead I get this:

    % git submodule init plugins/<TAB>
    plugins/commit-message-length-validator\ \(v1.0-rc1-9-g545000b\) plugins/reviewnotes\ \(v1.0-rc1-8-ge984300\)
    plugins/replication\ \(v1.1-rc0-13-g4c3f4c9\)

If I use --noglobalrcs I get the bash-style simple pathname behavior:

    $ zsh --noglobalrcs
    % git submodule init plugins/<TAB>
    commit-message-length-validator/ README reviewnotes/
    helloworld/ replication/

I believe this bug is new in 14.04. I did not see it until I updated from 13.10 to 14.04.
I tried different versions of git (going back to 1.7.6) and the bug persisted. I did not try different versions of zsh.

$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04

$ apt-cache policy zsh
zsh:
  Installed: 5.0.2-3ubuntu6
  Candidate: 5.0.2-3ubuntu6
  Version table:
 *** 5.0.2-3ubuntu6 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
$ apt-cache policy git
git:
  Installed: 1:1.9.1-1
  Candidate: 1:1.9.1-1
  Version table:
 *** 1:1.9.1-1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Axel Beckert (xtaran) wrote :

Can't reproduce this in Debian Unstable with zsh 5.0.5-2, hence this is likely fixed already and an update of Ubuntu's zsh package to 5.0.5-2 should fix it in Ubuntu, too.

Changed in zsh (Ubuntu):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.