Closed folliehiyuki closed 4 months ago
Hi @folliehiyuki!
Thanks so much for the contribution(s) 🎉
Could you please:
I'm the main fish maintainer, so I want to be sure I understand the feature fully and do some QA before merging!
I ran into the same issue with the CI previously, but the issue went away by itself before I could do anything to fix it. For some reason the fish PPA fails to install
Cannot add PPA: 'ppa:~fish-shell/ubuntu/release-3'.
ERROR: '~fish-shell' user or team does not exist.
Error: Process completed with exit code 1.
I'm suspecting an issue with the fish PPA. This is not caused by the code changes, the CI fails before the actual checks.
Just ran the test locally on my machine and they appear to be fine again. Could not test macos though, because act does not support this.
Give me a few test cases I can run locally on my machine with explicit detail to ensure the feature is working?
Just use git-forgit
and git forgit
as you normally do (while spamming the <TAB>
key)!
mkdir test-repo && cd test-repo
git init
touch file{1,2,3}
# See that the completion list includes all subcommands
git forgit <Tab>
git-forgit <Tab>
# Completion for `add`
git-forgit add <Tab><Tab>
git forgit add <Tab><Tab>
...
All the __fish_git_*
functions are sourced from the completion file of git, so you need it in-place first. It comes by default in every fish-shell package.
@folliehiyuki this is great! Working as you intended.
A couple questions:
glo <TAB
is very sad in comparision ) if you're feeling up to it, after this gets submitted one of us should go clean up those completions as well! This is a great upgrade.Let me know what you think on point 1. Depending on that we can submit.
On point 1, see https://fishshell.com/docs/current/completions.html#where-to-put-completions.
oh-my-fish
and fisher
are smart enough to put the completion into the right place in your $__fish_config_dir/completions
on installation (see https://github.com/jorgebucaran/replay.fish for an example of the repo structure the plugin managers understand, which we already follow nicely).<TAB>
on the corresponding command).So, it's better to put the fish completion in a separated file. It works with just the git-forgit
command inside $PATH
(I actually use git-forgit
this way without all the aliases). There is no need to source the fish plugin.
On point 2, as said above, I don't use the fish plugin personally, so it's hard to judge. My recommendation would be to use abbr instead of aliases, so, on the command line, pressing glo<Space>
would actually result to git forgit log
being displayed and we'll have nice completion (still with fewer key presses).
Awesome. Makes sense to me. Thanks again for the contribution @folliehiyuki ! merging it now.
If you feel you have energy to tune up the completions in the non-git-plugin version, another contribution would be greatly appreciated, otherwise I'll check it out when I have time.
Cheers!
fish's builtin git completion automatically registers
git-forgit
completions as completions forforgit
subcommand of git. Therefore this PR provides completions for both formatsgit-forgit
andgit forgit
.Simple subcommands get the completion list from
__fish_git_*
functions, while others requiring more than 1__fish_git_*
completion sources reuse the completion items from the corresponding git commands.Check list
Description
Type of change
Test environment