Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Jeff King <peff@peff.net>, Paul Jolly <paul@myitcv.io>,
	Git List <git@vger.kernel.org>
Subject: Re: Bash completion suggests tags for git branch -D
Date: Tue, 02 Feb 2021 13:29:57 -0800	[thread overview]
Message-ID: <xmqqlfc6f99m.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAPig+cQoCuQSyrKfE_sNCvi=Yo2035e0TOA1sOBF1HE02-kFjA@mail.gmail.com> (Eric Sunshine's message of "Tue, 2 Feb 2021 12:24:51 -0500")

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Tue, Feb 2, 2021 at 12:22 PM Junio C Hamano <gitster@pobox.com> wrote:
>> From: Jeff King <peff@peff.net>
>> Subject: [PATCH] completion: treat "branch -D" the same way as "branch -d"
>>
>> Paul Jolly noticed that the former offers not just branches but tags
>> as completion candidates.  Mimic how "branch -d" limits its suggestion
>> to branch names.
>>
>> Signed-off-by: Jeff King <peff@peff.net>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> Perhaps a Reported-by: would be appropriate?

Comparing the way I wrote the above, and a bland description of
"this is broken how" plus "Reported-by:", I personally feel the
former gives the credit in a more proper way, but if more people
prefer the more mechanical style, I can adjust.

Here is what I queued.

--- >8 ------ >8 ------ >8 ------ >8 ------ >8 ---
From: Jeff King <peff@peff.net>
Date: Tue, 2 Feb 2021 04:02:13 -0500
Subject: [PATCH] completion: treat "branch -D" the same way as "branch -d"

The former offers not just branches but tags as completion
candidates.

Mimic how "branch -d" limits its suggestion to branch names.

Reported-by: Paul Jolly <paul@myitcv.io>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 463a3124da..ba950a247d 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1438,7 +1438,7 @@ _git_branch ()
 	while [ $c -lt $cword ]; do
 		i="${words[c]}"
 		case "$i" in
-		-d|--delete|-m|--move)	only_local_ref="y" ;;
+		-d|--delete|-D|-m|--move)	only_local_ref="y" ;;
 		-r|--remotes)		has_r="y" ;;
 		esac
 		((c++))
-- 
2.30.0-586-g047f30a795


  reply	other threads:[~2021-02-02 21:30 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
2021-02-02 17:14     ` Junio C Hamano
2021-02-02 17:24       ` Eric Sunshine
2021-02-02 21:29         ` Junio C Hamano [this message]
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

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

  git send-email \
    --in-reply-to=xmqqlfc6f99m.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=paul@myitcv.io \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox