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>
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\))
Subject: Re: _git-reset doesn't complete newly staged files
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
In-Reply-To: <20160309132444.GA2428@tarsus.local2>
Date: Thu, 10 Mar 2016 21:03:59 +0900
Content-Transfer-Encoding: quoted-printable
Message-Id: <F614B9C0-B219-43E4-9A82-519F57D3DC84@kba.biglobe.ne.jp>
References: <20160309132444.GA2428@tarsus.local2>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
X-Mailer: Apple Mail (2.1510)
X-Biglobe-Spnum: 54482
X-Seq: zsh-workers 38126


On 2016/03/09, at 22:24, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Sorry for not replying earlier: I had this flagged for attention but
> haven't spoken up sooner since I expected I wouldn't have time to =
reply
> to responses.

You are exactly the one from whom I wanted to have comments.=20

> I think you're looking for =C2=ABgit diff-index --cached -z =
--name-only
> $treeish=C2=BB.

What I was not sure was whether to offer conflicting files or not.
'git reset conflicting_file' leaves the working tree unmodified
(so '<<<<<<< HEAD' etc. remain there) while the index becomes clean
(conflict fixed) and you can commit it. I thought this would not
be useful.

But it is not an error anyway, and maybe there are someone who
really want to do that (if they are going to run 'git reset' while
there is a conflict, they may well know what they are doing).

> I took the liberty of changing the tag and description you used, since
> "staged files" isn't exactly right for this syntax: files that are in
> $treeish but not staged may also be completed.

I thought those files are 'staged for delete', but your more
descriptive tag/description would be better.

> Incidentally, it would be nice to have a docstring for =
__git_ignore_line:

Yes, and

> Why does __git_ignore_line escape some characters with backslashes
> before adding them to $ignored?

I'm rather confused. Isn't it better to UN-quote them?

% touch 'a b.txt'
% git add <TAB>
this completes a\ b.txt, and
% git add a\ b.txt <TAB>
this still completes a\ b.txt.

Using
    ignored+=3D(${(Q)line[1,CURRENT-1]})
    ignored+=3D(${(Q)line[CURRENT+1,-1]})
fixes this. Moreover,

% git add *.txt <TAB>
this does not complete a\ b.txt anymore.

Or there are something I've overlooked.


