Web lists-archives.com

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




Chayoung You <yousbe@xxxxxxxxx> 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.