* Re: [PR PATCH] [Updated] git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
@ 2021-08-30 22:21 ` kkga
2021-08-30 22:47 ` [PR PATCH] [Merged]: " ericonr
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kkga @ 2021-08-30 22:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]
There is an updated pull request by kkga against master on the void-packages repository
https://github.com/kkga/void-packages git-extras
https://github.com/void-linux/void-packages/pull/32767
git-extras: install completions
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/32767.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-git-extras-32767.patch --]
[-- Type: text/x-diff, Size: 815 bytes --]
From 8c313a69847fbae61cbafc33f13e9063cc55cd7a Mon Sep 17 00:00:00 2001
From: Gadzhi Kharkharov <me@kkga.me>
Date: Tue, 31 Aug 2021 01:07:21 +0300
Subject: [PATCH] git-extras: install completions
---
| 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--git a/srcpkgs/git-extras/template b/srcpkgs/git-extras/template
index 948e5e01f929..cc941faa7a73 100644
--- a/srcpkgs/git-extras/template
+++ b/srcpkgs/git-extras/template
@@ -1,7 +1,7 @@
# Template file for 'git-extras'
pkgname=git-extras
version=6.2.0
-revision=1
+revision=2
build_style=gnu-makefile
depends="bash git"
short_desc="Little git extras"
@@ -19,4 +19,6 @@ post_patch() {
post_install() {
vlicense LICENSE
+ vcompletion etc/git-extras.fish fish
+ vcompletion etc/git-extras-completion.zsh zsh
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PR PATCH] [Merged]: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
2021-08-30 22:21 ` [PR PATCH] [Updated] " kkga
@ 2021-08-30 22:47 ` ericonr
2021-08-30 23:07 ` ericonr
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ericonr @ 2021-08-30 22:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]
There's a merged pull request on the void-packages repository
git-extras: install completions
https://github.com/void-linux/void-packages/pull/32767
Description:
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
2021-08-30 22:21 ` [PR PATCH] [Updated] " kkga
2021-08-30 22:47 ` [PR PATCH] [Merged]: " ericonr
@ 2021-08-30 23:07 ` ericonr
2021-08-31 5:41 ` kkga
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ericonr @ 2021-08-30 23:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-908766406
Comment:
Hm, I think we need to revert this. Installing those in the completion directories isn't really supported... https://github.com/tj/git-extras/blob/master/Makefile#L75
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (2 preceding siblings ...)
2021-08-30 23:07 ` ericonr
@ 2021-08-31 5:41 ` kkga
2021-08-31 5:44 ` kkga
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kkga @ 2021-08-31 5:41 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by kkga on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-908916186
Comment:
I can't test zsh, but fish completions work for me.
For zsh -- what do you mean? the file installed by `vcompletion` looks like any other zsh complections file to me.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (3 preceding siblings ...)
2021-08-31 5:41 ` kkga
@ 2021-08-31 5:44 ` kkga
2021-08-31 19:38 ` ericonr
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kkga @ 2021-08-31 5:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 397 bytes --]
New comment by kkga on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-908916186
Comment:
I can't test zsh, but fish completions work for me.
For zsh -- what do you mean? the file installed by `vcompletion` looks like any other zsh completions file to me. Does it matter that they're installed in `/usr/share/zsh/site-functions/` instead of `/etc`?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (4 preceding siblings ...)
2021-08-31 5:44 ` kkga
@ 2021-08-31 19:38 ` ericonr
2021-09-01 0:53 ` eli-schwartz
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ericonr @ 2021-08-31 19:38 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-909550587
Comment:
Supposedly because they aren't in the usual format (especially considering the file name matching the executable name). If it's working fine, we can leave as is then :)
Thanks!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (5 preceding siblings ...)
2021-08-31 19:38 ` ericonr
@ 2021-09-01 0:53 ` eli-schwartz
2021-09-01 0:58 ` eli-schwartz
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: eli-schwartz @ 2021-09-01 0:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 2764 bytes --]
New comment by eli-schwartz on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-909769962
Comment:
Shell completion systems follow a basic well known pattern, and what we are looking at here is, specifically, how that gets loaded at runtime.
There are two basic methods for loading a shell completion:
- source it in shell init
- source completion file in bashrc/fishrc/zshrc
- (bash-only) add file to `/etc/bash_completion.d/`, the "legacy directory", which, if completions are enabled, is looped over and every file in there gets sourced
- use a completion auto-loader
- bash: completionsdir, tab complete for commands without a defined completion will run `_completion_loader` which in turn runs `__load_completion` and returns successful injection, or falls back to a minimal (defined stub) completion for commands that have no completion file. Upon successfully returning injected completion, it messages bash via `return 124` to retry completion, using the loaded completion
- zsh: all fpath contents are scanned and indexed for files containing the comment `#compdef` on the first line, the rest of that line contains a description of the completions the file offers. ONLY IF A COMPDEF EXISTS, that file will then be consulted when you perform a tab completion for that command. The rest of the file then gets sourced dynamically when needed, and is expected to follow very specific styles; a valid compdef file is IIRC incompatible with a valid "just source this in shell init".
- fish: my understanding is it works like bash
Now, the problem with git-extras should be obvious. None of the files correspond to what you're actually completing. You tab complete `git release <TAB>` or something like that, not `git-extras` and not even `git extras`. So, bash and fish will never try to load the completion file, though they will try to load `git.fish` or `/usr/share/bash-completion/completions/git`. And the zsh completion uses zstyle, not `#compdef`.
So, this is why none of them, at all, work without manually sourcing the file. The auto-load directories which vcompletion sets up, are useless and do nothing.
...
Coincidentally, bash's legacy /etc/bash_completion.d/ directory does work, because the legacy bash completion style was "have some directory and source every file there on startup". Some completions, like git-extras, aren't even compatible with the non-legacy style, so they intentionally install to the legacy dir. The git-extras Makefile does precisely this.
`vcompletion etc/bash_completion.sh bash` would install to the `_completion_loader` compatible directory and do nothing.
zsh and fish do not have an analogue to bash-completion's legacy dir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (6 preceding siblings ...)
2021-09-01 0:53 ` eli-schwartz
@ 2021-09-01 0:58 ` eli-schwartz
2021-09-01 1:01 ` eli-schwartz
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: eli-schwartz @ 2021-09-01 0:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]
New comment by eli-schwartz on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-909772138
Comment:
> I can't test zsh, but fish completions work for me.
According to everything I know, this is literally impossible, unless one of two things is true:
- your `~/.config/fish/config.fish` is sourcing git-extras.fish
- you both have a valid executable called `git-extras` (fish will not load a completion for it if it does not exist) and try tab-completing `git-extras <TAB>`, in order to "auto-load" completions for `git release <TAB>` and friends. This is hardly user friendly, both because you have to complete some other random program first, and because you cannot even do it without manually setting up a fake executable which exists solely to trick fish into allowing a completion autoload
> For zsh -- what do you mean? the file installed by `vcompletion` looks like any other zsh completions file to me.
If you have not tested it, then I don't know how you can say this. It doesn't work. It certainly doesn't look like any other zsh completions file to *me*, though I do actually collect knowledge on this obscure subject due to... reasons.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (7 preceding siblings ...)
2021-09-01 0:58 ` eli-schwartz
@ 2021-09-01 1:01 ` eli-schwartz
2021-09-01 1:02 ` eli-schwartz
2021-09-01 1:06 ` eli-schwartz
10 siblings, 0 replies; 12+ messages in thread
From: eli-schwartz @ 2021-09-01 1:01 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 459 bytes --]
New comment by eli-schwartz on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-909773533
Comment:
FWIW on Arch I eventually opted to install the zsh and fish files to /usr/share/doc/git-extras/ which means that interested users, if they wish, have an installed path which they may source during shell startup to gain feature parity with bash.
Eager-loaded completions are meh and slow, but what can you do...
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (8 preceding siblings ...)
2021-09-01 1:01 ` eli-schwartz
@ 2021-09-01 1:02 ` eli-schwartz
2021-09-01 1:06 ` eli-schwartz
10 siblings, 0 replies; 12+ messages in thread
From: eli-schwartz @ 2021-09-01 1:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]
New comment by eli-schwartz on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-909769962
Comment:
Shell completion systems follow a basic well known pattern, and what we are looking at here is, specifically, how that gets loaded at runtime.
There are two basic methods for loading a shell completion:
- source it in shell init
- source completion file in bashrc/config.fish/zshrc
- (bash-only) add file to `/etc/bash_completion.d/`, the "legacy directory", which, if completions are enabled, is looped over and every file in there gets sourced
- use a completion auto-loader
- bash: completionsdir, tab complete for commands without a defined completion will run `_completion_loader` which in turn runs `__load_completion` and returns successful injection, or falls back to a minimal (defined stub) completion for commands that have no completion file. Upon successfully returning injected completion, it messages bash via `return 124` to retry completion, using the loaded completion
- zsh: all fpath contents are scanned and indexed for files containing the comment `#compdef` on the first line, the rest of that line contains a description of the completions the file offers. ONLY IF A COMPDEF EXISTS, that file will then be consulted when you perform a tab completion for that command. The rest of the file then gets sourced dynamically when needed, and is expected to follow very specific styles; a valid compdef file is IIRC incompatible with a valid "just source this in shell init".
- fish: my understanding is it works like bash
Now, the problem with git-extras should be obvious. None of the files correspond to what you're actually completing. You tab complete `git release <TAB>` or something like that, not `git-extras` and not even `git extras`. So, bash and fish will never try to load the completion file, though they will try to load `git.fish` or `/usr/share/bash-completion/completions/git`. And the zsh completion uses zstyle, not `#compdef`.
So, this is why none of them, at all, work without manually sourcing the file. The auto-load directories which vcompletion sets up, are useless and do nothing.
...
Coincidentally, bash's legacy /etc/bash_completion.d/ directory does work, because the legacy bash completion style was "have some directory and source every file there on startup". Some completions, like git-extras, aren't even compatible with the non-legacy style, so they intentionally install to the legacy dir. The git-extras Makefile does precisely this.
`vcompletion etc/bash_completion.sh bash` would install to the `_completion_loader` compatible directory and do nothing.
zsh and fish do not have an analogue to bash-completion's legacy dir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: git-extras: install completions
2021-08-30 22:09 [PR PATCH] git-extras: install completions kkga
` (9 preceding siblings ...)
2021-09-01 1:02 ` eli-schwartz
@ 2021-09-01 1:06 ` eli-schwartz
10 siblings, 0 replies; 12+ messages in thread
From: eli-schwartz @ 2021-09-01 1:06 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 2818 bytes --]
New comment by eli-schwartz on void-packages repository
https://github.com/void-linux/void-packages/pull/32767#issuecomment-909769962
Comment:
Shell completion systems follow a basic well known pattern, and what we are looking at here is, specifically, how that gets loaded at runtime.
There are two basic methods for loading a shell completion:
- source it in shell init
- source completion file in bashrc/config.fish/zshrc
- (bash-only) add file to `/etc/bash_completion.d/`, the "legacy directory", which, if completions are enabled, is looped over and every file in there gets sourced
- use a completion auto-loader
- bash: completionsdir, tab complete for commands without a defined completion will run `_completion_loader` which in turn runs `__load_completion` and returns successful injection, or falls back to a minimal (defined stub) completion for commands that have no completion file. Upon successfully returning injected completion, it messages bash via `return 124` to retry completion, using the loaded completion
- zsh: all fpath contents are scanned and indexed for files containing the comment `#compdef` on the first line, the rest of that line contains a description of the completions the file offers. ONLY IF A COMPDEF EXISTS, that file will then be consulted when you perform a tab completion for that command. The rest of the file then gets sourced dynamically when needed, and is expected to follow very specific styles (utilizing completion widgets e.g. `_arguments`); a valid compdef file is IIRC incompatible with a valid "just source this in shell init".
- fish: my understanding is it works like bash
Now, the problem with git-extras should be obvious. None of the files correspond to what you're actually completing. You tab complete `git release <TAB>` or something like that, not `git-extras` and not even `git extras`. So, bash and fish will never try to load the completion file, though they will try to load `git.fish` or `/usr/share/bash-completion/completions/git`. And the zsh completion uses zstyle, not `#compdef`.
So, this is why none of them, at all, work without manually sourcing the file. The auto-load directories which vcompletion sets up, are useless and do nothing.
...
Coincidentally, bash's legacy /etc/bash_completion.d/ directory does work, because the legacy bash completion style was "have some directory and source every file there on startup". Some completions, like git-extras, aren't even compatible with the non-legacy style, so they intentionally install to the legacy dir. The git-extras Makefile does precisely this.
`vcompletion etc/bash_completion.sh bash` would install to the `_completion_loader` compatible directory and do nothing.
zsh and fish do not have an analogue to bash-completion's legacy dir
^ permalink raw reply [flat|nested] 12+ messages in thread