zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: perforce completion patch
Date: Tue, 16 Sep 2014 20:35:25 +0100	[thread overview]
Message-ID: <20140916203525.119cd15f@pws-pc.ntlworld.com> (raw)
In-Reply-To: <1410810987.1055986.167801549.1F9D6403@webmail.messagingengine.com>

On Mon, 15 Sep 2014 15:56:27 -0400
Anthony Heading <anthony@ajrh.net> wrote:
> I've had the following small patch for perforce completion sitting
> around for a while,  it
> tried to fix e.g. the completion of "foo" when doing  "p4 add
> foo/bar.cpp".   That said,
> it runs against the goal of the surrounding comments which aim to skip
> directories;  I
> couldn't work out though why that would ever be desirable.

The line you've changed is handling the case of unmaintained files
requested (-tu => unmaintained=1) without directories being requested
(no -td => dodirs='').  This is what the p4 add completion currently does,
but it probably does need to complete directories.  p4 add is the only case
where -tu is passed in.  So it probably doesn't make sense to test for
-z $dodirs there.

What I can't remember and can't test at the moment without a lot of
fiddling is whether that means the code in that function is supposed to
work by adding unmaintained files and directories in some other branch
-- but I doubt it because that seems to be the only branch explicitly
checking for unmaintained files.

So it might simply be a case (as well as changing the glob) of removing
the spurious "&& -z $dodirs" (which is true because of the way the
caller works but confusing) and modifying the following comment to say
we always complete directories and hence ignore the -td flag in that
branch.

Of course this isn't going to be smart enough to add only directories
that contain unmaintained files but that fits with other uses of
directory completion which give you the opportunity of completing files
rather than the assurance they're there.

pws


  reply	other threads:[~2014-09-16 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 19:56 Anthony Heading
2014-09-16 19:35 ` Peter Stephenson [this message]
2014-09-23 10:14   ` Peter Stephenson

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=20140916203525.119cd15f@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).