threads / patch / 51255

patchcompletion (zsh): fix misleading install location

Subject: [PATCH] completion (zsh): fix misleading install location

## tl;dr

5 messages between Jun 6, 2019 and Oct 1, 2019. Diffs are folded; open one to read it.

replies: 4people: 4as markdown or json

Durant Schoon· Jun 6, 2019, 21:38 UTC · lore

When the code comment in the zsh completion suggests that this file should be copied to `~/.zsh`, many users might be misled to believe that this refers to a file location. But it refers to a directory, and won't work when it is a file.

Let's just add a slash, to make it abundantly clear that this must be a directory.

(thank you to Johannes Schindelin for the suggested wording and title)
Signed-off-by: B. Durant Schoon durant.schoon@gmail.com
---
 contrib/completion/git-completion.zsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.zsh +2 −3
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 886bf95d1f594..0e63004e2613e 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -11,8 +11,8 @@
 #
 #  zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
 #
-# The recommended way to install this script is to copy to '~/.zsh/_git', and
-# then add the following to your ~/.zshrc file:
+# The recommended way to install this script is to copy to '~/.zsh/_git/',
+# and then add the following to your ~/.zshrc file:
 #
 #  fpath=(~/.zsh $fpath)
 

--
https://github.com/git/git/pull/609
Denton Liu· Jun 6, 2019, 22:44 UTC · re: Durant Schoon · lore

Re: [PATCH] completion (zsh): fix misleading install location

Hi Durant,
Just a couple of small things:
On Thu, Jun 06, 2019 at 09:38:54PM +0000, Durant Schoon wrote:
Show 9 quoted lines
> When the code comment in the zsh completion suggests that this file
> should be copied to `~/.zsh`, many users might be misled to believe that
> this refers to a file location. But it refers to a directory, and won't
> work when it is a file.
> 
> Let's just add a slash, to make it abundantly clear that this must be a
> directory.
> 
> (thank you to Johannes Schindelin for the suggested wording and title)

Maybe this would be better incorporated as a Helped-by: or Suggested-by: tag at the bottom?

> 
> Signed-off-by: B. Durant Schoon durant.schoon@gmail.com

The email in your sign-off line should be wrapped in <>, i.e. it should be

	B. Durant Schoon <durant.schoon@gmail.com>
Other than that, the patch looks fine to me.
Thanks,
Denton
Show 22 quoted lines
> ---
>  contrib/completion/git-completion.zsh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
> index 886bf95d1f594..0e63004e2613e 100644
> --- a/contrib/completion/git-completion.zsh
> +++ b/contrib/completion/git-completion.zsh
> @@ -11,8 +11,8 @@
>  #
>  #  zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
>  #
> -# The recommended way to install this script is to copy to '~/.zsh/_git', and
> -# then add the following to your ~/.zshrc file:
> +# The recommended way to install this script is to copy to '~/.zsh/_git/',
> +# and then add the following to your ~/.zshrc file:
>  #
>  #  fpath=(~/.zsh $fpath)
>  
> 
> --
> https://github.com/git/git/pull/609
Felipe Contreras· Jun 6, 2019, 22:52 UTC · re: Durant Schoon · lore

Re: [PATCH] completion (zsh): fix misleading install location

On Thu, Jun 6, 2019 at 5:37 PM Durant Schoon <durant.schoon@gmail.com> wrote:
Show 12 quoted lines
> diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
> index 886bf95d1f594..0e63004e2613e 100644
> --- a/contrib/completion/git-completion.zsh
> +++ b/contrib/completion/git-completion.zsh
> @@ -11,8 +11,8 @@
>  #
>  #  zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
>  #
> -# The recommended way to install this script is to copy to '~/.zsh/_git', and
> -# then add the following to your ~/.zshrc file:
> +# The recommended way to install this script is to copy to '~/.zsh/_git/',
> +# and then add the following to your ~/.zshrc file:
~/.zsh/_git should be a file, not a directory.
-- 
Felipe Contreras
Durant Schoon· Sep 24, 2019, 20:51 UTC · re: Durant Schoon · lore

When the code comment in the zsh completion suggests that this file should be copied to `~/.zsh`, many users might be misled to believe that this refers to a file location. But it refers to a directory, and won't work when it is a file.

Let's just add a slash, to make it abundantly clear that this must be a directory.

Signed-off-by: B. Durant Schoon <durant.schoon@gmail.com>
Helped-by: Johannes Schindelin
---
 contrib/completion/git-completion.zsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.zsh +2 −3
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 886bf95d1f594..0e63004e2613e 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -11,8 +11,8 @@
 #
 #  zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
 #
-# The recommended way to install this script is to copy to '~/.zsh/_git', and
-# then add the following to your ~/.zshrc file:
+# The recommended way to install this script is to copy to '~/.zsh/_git/',
+# and then add the following to your ~/.zshrc file:
 #
 #  fpath=(~/.zsh $fpath)
 

--
https://github.com/git/git/pull/609
Maxim Belsky· Oct 1, 2019, 21:05 UTC · re: Durant Schoon · lore

Re: [PATCH] completion (zsh): fix misleading install location

Hey, 
I face same issue a few days ago. Initially I thought `~/.zsh/_git` should be a dictionary. I’ve made all required actions, but completion didn't work. After a few hours I found that it should be just a file instead of a dictionary.
I have two ideas how to patch this comments to help another users setup completion:
1. Add a note that `~/.zsh/_git` should be a file https://github.com/mbelsky/git/commit/e951a0dee5f124ad755d32fa5cc5cded471d389b 
2. Change the patch to make it more obvious https://github.com/mbelsky/git/commit/6c839727163b29b2d2cf5d2ec7f780c2826848d6
It’s my first time mail listing experience so I just put links on github to don’t make something wrong.
What do you think about this changes? 
Show 14 quoted lines
> On 7 Jun 2019, at 00:38, Durant Schoon <durant.schoon@gmail.com> wrote:
> 
> diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
> index 886bf95d1f594..0e63004e2613e 100644
> --- a/contrib/completion/git-completion.zsh
> +++ b/contrib/completion/git-completion.zsh
> @@ -11,8 +11,8 @@
> #
> #  zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
> #
> -# The recommended way to install this script is to copy to '~/.zsh/_git', and
> -# then add the following to your ~/.zshrc file:
> +# The recommended way to install this script is to copy to '~/.zsh/_git/',
> +# and then add the following to your ~/.zshrc file:

← back to recent threads