Bash completion suggests tags for git branch -D
- From
Paul Jolly <paul@myitcv.io>
- Date
- Feb 2, 2021, 06:01 UTC
- Message-ID
- <CACoUkn6+9C3+HVVQF905t1siAD9Sqo1JvRa0Whw-J6x7V7icyg@mail.gmail.com>
Hi,
Easiest explained via a repro:
cd $(mktemp -d)
git init
touch README
git add -A
git commit -am 'Initial commit'
git checkout -b branch
git tag b-is-a-tagIf you then type:
git branch -D b^
leaving the cursor at the position shown by the caret, then attempt completion via <Tab><Tab> (at least according to my bash setup) two options are shown:
b-is-a-tag branch
b-is-a-tag is not a branch, so should not be offered as a completion candidate in this instance.
Many thanks,
Paul