Zsh Mailing List Archive
Messages sorted by:
Re: Git-add completion should show full file paths
- X-seq: zsh-workers 45728
- From: dana <dana@xxxxxxx>
- To: Amyn Bennamane <amynbe@xxxxxxxxx>
- Subject: Re: Git-add completion should show full file paths
- Date: Mon, 27 Apr 2020 14:25:55 -0500
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <CAJ=fZjNLqQi3oLvzf3pd9j7OVKNMS3i_759dFrNWPkOM7yYKug@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAJ=fZjNLqQi3oLvzf3pd9j7OVKNMS3i_759dFrNWPkOM7yYKug@mail.gmail.com>
On 26 Apr 2020, at 17:57, Amyn Bennamane <amynbe@xxxxxxxxx> wrote:
> Can anyone here comment on the above idea and/or suggest a way to
> implement this?
I've often wished it worked the way you suggested, but not always.
If i have two unstaged files like a/b/c/d/e/foo and a/b/c/d/f/bar, then having
it complete the full paths is useful, because there are only a few and i don't
want to repeatedly tab (or write out the correct pattern / abbreviated path)
to recurse into those directories.
But if i have 20 unstaged files that are all under a/b/c/d/e, i would rather
the completion assist me with adding that entire directory than show me a
million giant file paths.
I guess what Daniel is suggesting is basically an on/off switch for
_multi_parts's intended function, and you can turn it off for git if you want.
That'd work fine as long as you don't expect to run into the latter case very
I wonder if it could be more intelligent though — maybe this style could take
an integer that acts as a threshold for whether it should work the normal way
or the 'dumb' way? Like if there are more than x files with the same prefix or
whatever. Not sure how you'd calculate it, but something like that.
Also, whether it's like that or just a boolean, it seems like you'd also need
to consider how recursive completion should work, or if it should, in the
'dumb' case. I think users are accustomed to being able to expand like
f/b/b<TAB> -> foo/bar/baz with file paths, and it would be confusing if that
only worked some of the time... though they would have to go out of their way
to set it like that, so idk
Messages sorted by: