git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Paul Jolly <paul@myitcv.io>
Cc: git@vger.kernel.org
Subject: Re: Bash completion suggests tags for git branch -D
Date: Tue, 2 Feb 2021 04:21:33 -0500	[thread overview]
Message-ID: <YBkZnY8X5VyNkXkR@coredump.intra.peff.net> (raw)
In-Reply-To: <YBkVFTOP6K1//i6m@coredump.intra.peff.net>

On Tue, Feb 02, 2021 at 04:02:13AM -0500, Jeff King wrote:

> > 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

  reply	other threads:[~2021-02-02  9:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  6:01 Bash completion suggests tags for git branch -D Paul Jolly
2021-02-02  9:02 ` Jeff King
2021-02-02  9:21   ` Jeff King [this message]
2021-02-02 17:14     ` Junio C Hamano
2021-02-02 17:24       ` Eric Sunshine
2021-02-02 21:29         ` Junio C Hamano
2021-02-02 19:38       ` Jeff King
2021-02-02 20:25         ` Paul Jolly
2021-02-03 20:00       ` SZEDER Gábor
2021-02-03 20:59         ` [PATCH] completion: handle other variants of "branch -m" Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YBkZnY8X5VyNkXkR@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=paul@myitcv.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).