Re: Bash completion suggests tags for git branch -D
- From
Jeff King <peff@peff.net>
- Date
- Feb 2, 2021, 09:21 UTC
- Message-ID
- <YBkZnY8X5VyNkXkR@coredump.intra.peff.net>
- In-Reply-To
- <YBkVFTOP6K1//i6m@coredump.intra.peff.net>
On Tue, Feb 02, 2021 at 04:02:13AM -0500, Jeff King wrote:
Show 18 quoted lines
> > b-is-a-tag is not a branch, so should not be offered as a completion
> > candidate in this instance.
>
> It looks like lowercase "-d" works. So maybe the "-d" here:
>
> $ sed -n '/git_branch/,/^}/p' contrib/completion/git-completion.bash | head
> _git_branch ()
> {
> local i c=1 only_local_ref="n" has_r="n"
>
> while [ $c -lt $cword ]; do
> i="${words[c]}"
> case "$i" in
> -d|--delete|-D|-m|--move) only_local_ref="y" ;;
> -r|--remotes) has_r="y" ;;
> esac
>
> just needs to look for "-D", too?Oops. I meant to paste the "before" snippet, but this is obviously after I stuck "-D" in there. It does seem to work. :)
-Peff