git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] completion: restore 'remote rm'

From
KSKeith Smiley <k@keith.so>
Date
Dec 29, 2017, 16:49 UTC
Message-ID
<20171229164949.GA48812@bryant.local>
In-Reply-To
<20171229135240.GQ3693@zaya.teonanacatl.net>
Updated:

e17dba8fe1 ("remote: prefer subcommand name 'remove' to 'rm'", 2012-09-06) removed the 'rm' subcommand from completion. The 'remote rm' subcommand is still supported and not planned to be removed. Offer completions for it.

Signed-off-by: Keith Smiley <k@keith.so>
---
 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 3683c772c5586..3e9044087e6ba 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2665,7 +2665,7 @@ _git_config ()
 _git_remote ()
 {
 	local subcommands="
-		add rename remove set-head set-branches
+		add rename remove rm set-head set-branches
 		get-url set-url show prune update
 		"
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"

--
Keith Smiley

On 12/29, Todd Zullinger wrote:
>Keith Smiley wrote:
>> It looks like that was just about preferring remove in documentation
>> and the like, I think it would still make sense to have both for
>> completion since rm is still supported.
>
>I read it as a first step in a long process to eventually
>remove 'remote rm', but if that's never intended, then sure,
>restoring completion for it seems reasonable.
>
>It would be good to hear from those who know or recall the
>intention.
>
>I think we should only complete the preferred subcommand.
>That encourages use of 'remote remove' even if 'remote rm'
>will stay forever to avoid breaking existing scripts.
>
>If it does make sense to restore completion, adding a link
>back to e17dba8fe1 and explaining why the completion is
>being restored would be good.  Reading the commit message
>now makes it sound like 'remote rm' was never present and is
>being added to correct an oversight.
>
>Maybe something like:
>
>    completion: restore 'remote rm'
>
>    e17dba8fe1 ("remote: prefer subcommand name 'remove' to
>    'rm'", 2012-09-06) removed the 'rm' subcommand from
>    completion.  The 'remote rm' subcommand is still supported
>    and not planned to be removed.  Offer completions for it.
>
>I also noticed that in your original commit that you say
>"list of removes as remove does." That should be "remotes"
>instead of "removes" there. -- I've made that typo myself
>quite often. :)
>
>-- 
>Todd
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>There are no stupid questions, but there are a LOT of inquisitive
>idiots.
>    -- Demotivators (www.despair.com)
>
Previous: Todd ZullingerNext: SZEDER Gábor
Message 5 of 23 in “Add shell completion for git remote rm”
  1. Add shell completion for git remote rmKeith Smiley, Dec 29, 2017
  2. Todd ZullingerDec 29, 2017
  3. Keith SmileyDec 29, 2017
  4. Todd ZullingerDec 29, 2017
  5. Keith SmileyDec 29, 2017
  6. SZEDER GáborDec 29, 2017
  7. Keith SmileyDec 29, 2017
  8. Ævar Arnfjörð BjarmasonDec 29, 2017
  9. Todd ZullingerDec 30, 2017
  10. Ævar Arnfjörð BjarmasonDec 30, 2017
  11. Keith SmileyDec 31, 2017
  12. Junio C HamanoJan 3, 2018
  13. Keith SmileyJan 15, 2018
  14. Duy NguyenJan 16, 2018
  15. Junio C HamanoJan 16, 2018
  16. Duy NguyenJan 17, 2018
  17. Kevin DaudtJan 17, 2018
  18. Duy NguyenJan 17, 2018
  19. Keith SmileyJul 16, 2018
  20. Junio C HamanoJan 17, 2018
  21. Duy NguyenJan 1, 2018
  22. Kevin DaudtDec 29, 2017
  23. Keith SmileyDec 29, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.