Skip to content

Don't list git subcommands twice in completions - #1290

Merged
fdncred merged 1 commit into
nushell:mainfrom
qodelicious:fix-git-duplicate-subcommands
Oct 19, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
qodelicious:fix-git-duplicate-subcommands

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

Fixes #1197

When you source the git completions and type git ad<tab>, add shows up twice. One comes from the git add extern and the other from the command parameter on git, which completes everything in git help -a.

Instead of dropping the command completion completely (like suggested in the issue), this filters out subcommands that already have their own extern. That way git aliases and commands without an extern still complete.

Tested with nu 0.116.2 using --ide-complete. Before the change git ad gives add and git add, after it only git add. Aliases like co still show up for git c.

Subcommands with their own extern were showing up twice when completing git <tab>, once from the extern and once from git help -a. Leave those out of the git command completion. Aliases and commands without an extern still complete.
@fdncred
fdncred merged commit 9af4c03 into nushell:main Oct 19, 2026
1 check passed
@fdncred

fdncred commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git has duplicate subcommands completion

2 participants