zsh-workers
 help / color / mirror / code / Atom feed
* _git-reset doesn't complete newly staged files
@ 2016-02-26  8:08 Jun T.
  2016-03-03  5:07 ` Jun T.
  0 siblings, 1 reply; 11+ messages in thread
From: Jun T. @ 2016-02-26  8:08 UTC (permalink / raw)
  To: zsh-workers

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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-03-11 22:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26  8:08 _git-reset doesn't complete newly staged files Jun T.
2016-03-03  5:07 ` Jun T.
2016-03-07  3:16   ` Jun T.
2016-03-09 13:24   ` Daniel Shahaf
2016-03-09 23:33     ` Daniel Shahaf
2016-03-10 23:15       ` [PATCH] _git: Fix completion of diffs against the index when treeish isn't shell-safe Daniel Shahaf
2016-03-10 12:03     ` _git-reset doesn't complete newly staged files Jun T.
2016-03-10 14:35       ` Mikael Magnusson
2016-03-10 23:20       ` __git_ignore_line positional argument (un)escaping (was: Re: _git-reset doesn't complete newly staged files) Daniel Shahaf
2016-03-11  8:24         ` Jun T.
2016-03-11 22:13           ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).