Subject: _git-reset doesn't complete newly staged files
From: "Jun T." <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Fri, 26 Feb 2016 17:08:11 +0900
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Suppose we are in a simple git repo with two files:
% ls
foo.c    main.c

Now create a new file and stage it:
% vi bar.c
% git add bar.c
% git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   bar.c
#

Then if I type
% git reset HEAD <TAB>
foo.c   main.c          # bar.c is NOT offered.

_git-reset() calls __git_tree_files(), which lists only
the already tracked files.

Maybe we could use
git status -uno --porcelain | grep '^[ADM]'
to get a list of staged files (files which can be reset)?

In the case of 'git reset <TAB>' or 'git reset HEAD <TAB>',
I think it would be better to offer only bar.c (because
'git reset HEAD main.c' is just a nop), but at least
bar.c need be offered in addition to foo.c and main.c.