Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
X-Biglobe-Sender: <takimoto-j@kba.biglobe.ne.jp>
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: _git-reset doesn't complete newly staged files
Message-Id: <0FD99C66-391B-4971-ABD2-3595A0EB21CB@kba.biglobe.ne.jp>
Date: Fri, 26 Feb 2016 17:08:11 +0900
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\))
X-Mailer: Apple Mail (2.1510)
X-Biglobe-Spnum: 51969
X-Seq: zsh-workers 38033

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.

