zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Amyn Bennamane <amynbe@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Git-add completion should show full file paths
Date: Mon, 27 Apr 2020 14:25:55 -0500	[thread overview]
Message-ID: <585FABCB-9B6A-47F8-886E-B24E359F8F51@dana.is> (raw)
In-Reply-To: <CAJ=fZjNLqQi3oLvzf3pd9j7OVKNMS3i_759dFrNWPkOM7yYKug@mail.gmail.com>

On 26 Apr 2020, at 17:57, Amyn Bennamane <amynbe@gmail.com> 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
often.

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

dana


  reply	other threads:[~2020-04-27 19:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 22:57 Amyn Bennamane
2020-04-27 19:25 ` dana [this message]
2020-04-28  4:35   ` Bart Schaefer
2020-04-28 18:01     ` Daniel Shahaf
2020-04-29  3:42       ` Bart Schaefer
2020-04-29  9:21         ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=585FABCB-9B6A-47F8-886E-B24E359F8F51@dana.is \
    --to=dana@dana.is \
    --cc=amynbe@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).