git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Chayoung You <yousbe@gmail.com>
Cc: git@vger.kernel.org, "SZEDER Gábor" <szeder.dev@gmail.com>
Subject: Re: [PATCH] completion: escape metacharacters when completing paths
Date: Fri, 28 Dec 2018 15:25:58 -0800	[thread overview]
Message-ID: <xmqqefa1kzcp.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20181226160835.66342-1-yousbe@gmail.com> (Chayoung You's message of "Thu, 27 Dec 2018 01:08:35 +0900")

Chayoung You <yousbe@gmail.com> writes:

> Subject: Re: [PATCH] completion: escape metacharacters when completing paths

I am not a zsh user, but from the patch text I am getting the
impression that this patch is only about zsh.  If so, please help
readers of "git shortlog" by saying so in the title.

	Subject: zsh: complete unquoted paths with spaces correctly

or something like that, perhaps?

> Let's say there is a file named 'foo bar.txt' in repository, but it's
> not yet added to the repository. Then the following command triggers a
> completion:
>
>   git add fo<Tab>
>   git add 'fo<Tab>
>   git add "fo<Tab>
>
> The completion results in bash:
>
>   git add foo\ bar.txt
>   git add 'foo bar.txt'
>   git add "foo bar.txt"
>
> While them in zsh:
>
>   git add foo bar.txt
>   git add 'foo bar.txt'
>   git add "foo bar.txt"

You leave it unsaid what you think is wrong, and what you think
should be the right output, before saying "cause of this is...".

I do not think it is given that "git add fo<TAB>" should be
completed to "git add foo\ bar.txt".  It would also be OK if the
completion produced "git add 'foo bar.txt'", for example.  So what
your ideal output is is rather important, and by doing that you end
up with saying what problem you have with the current output is.

So, say something here, perhaps like...

	The first one, where the pathname is not enclosed in quotes,
	should escape the SP with a backslash, just like bash
	completion does.


  reply	other threads:[~2018-12-28 23:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26 16:08 [PATCH] completion: escape metacharacters when completing paths Chayoung You
2018-12-28 23:25 ` Junio C Hamano [this message]
2018-12-30  5:31   ` [PATCH v2] zsh: complete unquoted paths with spaces correctly Chayoung You
2019-01-01 14:05     ` [PATCH v3 0/2] completion: handle " Chayoung You
2019-01-01 14:05       ` [PATCH v3 1/2] zsh: complete unquoted " Chayoung You
2019-01-01 14:05       ` [PATCH v3 2/2] completion: treat results of git ls-tree as file paths Chayoung You

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqefa1kzcp.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=szeder.dev@gmail.com \
    --cc=yousbe@gmail.com \
    /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://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).