Skip to content

fix(completion): complete branch names for git graft in fish - #1286

Merged
hyperupcall merged 1 commit into
tj:mainfrom
rawsun007:fish-graft-branch-completion
Nov 19, 2026
Merged

hyperupcall merged 1 commit into
tj:mainfrom
rawsun007:fish-graft-branch-completion

Conversation

@rawsun007

Copy link
Copy Markdown
Contributor

The fish completions for git graft declared its two branch arguments as a -r/--remote option (lines 163-164 of etc/git-extras.fish). git-graft takes <src-branch> <dest-branch> and has no options. Because the branch list was attached to that option, git graft <Tab> offered files instead of branches, and git graft -<Tab> offered --remote, which graft would take as the source branch name.

The fix completes branch names as plain arguments, the way delete-branch, merge-into and squash already do, and matching the zsh (_git-graft) and bash (_git_graft) completions.

With fish 4.9.3, after sourcing the file, complete -C "git graft " lists files on main and main Local Branch and the other branches with the fix. complete -C "git graft -" no longer lists -r/--remote. Tested on macOS only. ./check_integrity.sh passes.

AI disclosure: found and written with Claude Code (claude-opus-5-5); the commit carries an Assisted-by: trailer.

The fish completions declared graft's two branch arguments as a
`-r`/`--remote` option, which git-graft does not have. Because the
branch list was attached to that option, `git graft <Tab>` offered
files instead of branches, and `git graft -<Tab>` offered `--remote`.
Complete branch names as plain arguments, as the zsh and bash
completions do.

Assisted-by: Claude Code (claude-opus-5-5)
@hyperupcall

Copy link
Copy Markdown
Collaborator

Thanks

@hyperupcall
hyperupcall merged commit e048f42 into tj:main Nov 19, 2026
5 checks passed
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.

3 participants