Complete custom "git-foo" commands from "git foo" commandlines by krobelus · Pull Request #7652 · fish-shell/fish-shell

soraxas

soraxas

@krobelus

Since fish-shell#7075, git-foo.fish files are sourced when Git completions are loaded.
However, at least Cobra (CLI framework for Go) provides completions like

	complete git-foo ...

This means that completions are only offered when typing "git-foo <TAB>"
and not on "git foo <TAB>". Fix this by forwarding the completion requests.
Take care to only forward if there are actually completions for "git-foo",
to avoid adding filename completions.

krobelus added a commit that referenced this pull request

Feb 2, 2021
Some third party Git tools provide a man page, which we can at least use
for completing options.

The old logic excluded all generated completions for Git subcommands.
Instead, try to load completions for all available external subcommands.
We can use $PATH/git-* because /bin/git-add and friends were removed in Git
1.6.0 in 2008.

Closes #4358 (the "git-foo" wrapping was added in #7652)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators

Aug 1, 2021