From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Todd Zullinger" <tmz@pobox.com>,
"SZEDER Gábor" <szeder.dev@gmail.com>,
"Keith Smiley" <k@keith.so>,
git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Kevin Daudt" <me@ikke.info>
Subject: Re: [PATCH] Add shell completion for git remote rm
Date: Wed, 03 Jan 2018 11:24:04 -0800 [thread overview]
Message-ID: <xmqq373miw4r.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <87vago76i8.fsf@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Sat, 30 Dec 2017 13:19:27 +0100")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> On Sat, Dec 30 2017, Todd Zullinger jotted:
>
>> And I think that should also apply to
>> not offering completion for commands/subcommands/options
>> which are only kept for backward compatibility.
>
> Yeah I think it makes sense to at some point stop completing things if
> we're going to remove stuff, if we decide to remove it.
>
>> Here's one way to make 'git remote rm <TAB>' work without
>> including it in the output of 'git remote <TAB>':
>>
>> diff --git i/contrib/completion/git-completion.bash w/contrib/completion/git-completion.bash
>> index 3683c772c5..aa63f028ab 100644
>> --- i/contrib/completion/git-completion.bash
>> +++ w/contrib/completion/git-completion.bash
>> @@ -2668,7 +2668,9 @@ _git_remote ()
>> add rename remove set-head set-branches
>> get-url set-url show prune update
>> "
>> - local subcommand="$(__git_find_on_cmdline "$subcommands")"
>> + # Don't advertise rm by including it in subcommands, but complete
>> + # remotes if it is used.
>> + local subcommand="$(__git_find_on_cmdline "$subcommands rm")"
>> if [ -z "$subcommand" ]; then
>> case "$cur" in
>> --*)
>
> Neat!
Yes, indeed it is nice.
next prev parent reply other threads:[~2018-01-03 19:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-29 2:01 [PATCH] Add shell completion for git remote rm Keith Smiley
2017-12-29 3:29 ` Todd Zullinger
2017-12-29 4:19 ` Keith Smiley
2017-12-29 13:52 ` Todd Zullinger
2017-12-29 16:49 ` [PATCH] completion: restore 'remote rm' Keith Smiley
2017-12-29 22:48 ` [PATCH] Add shell completion for git remote rm SZEDER Gábor
2017-12-29 23:19 ` Keith Smiley
2017-12-29 23:20 ` Ævar Arnfjörð Bjarmason
2017-12-30 0:52 ` Todd Zullinger
2017-12-30 12:19 ` Ævar Arnfjörð Bjarmason
2017-12-31 20:44 ` Keith Smiley
2018-01-03 19:24 ` Junio C Hamano [this message]
2018-01-15 21:43 ` Keith Smiley
2018-01-16 10:02 ` Duy Nguyen
2018-01-16 18:57 ` Junio C Hamano
2018-01-17 0:44 ` Duy Nguyen
2018-01-17 6:17 ` Kevin Daudt
2018-01-17 9:48 ` Duy Nguyen
2018-07-16 13:12 ` Keith Smiley
2018-01-17 18:20 ` Junio C Hamano
2018-01-01 23:46 ` Duy Nguyen
2017-12-29 6:00 ` Kevin Daudt
2017-12-29 6:21 ` Keith Smiley
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=xmqq373miw4r.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=k@keith.so \
--cc=me@ikke.info \
--cc=pclouds@gmail.com \
--cc=szeder.dev@gmail.com \
--cc=tmz@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.