Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
_git-reset doesn't complete newly staged files
- X-seq: zsh-workers 38033
- From: "Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: _git-reset doesn't complete newly staged files
- Date: Fri, 26 Feb 2016 17:08:11 +0900
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author