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

[PATCH 1/8] bash completion: Add completion for 'git clone'

From
Lee Marlow <lee.marlow@gmail.com>
Date
Aug 5, 2008, 05:50 UTC
Message-ID
<1217915438-6838-2-git-send-email-lee.marlow@gmail.com>
In-Reply-To
<1217915438-6838-1-git-send-email-lee.marlow@gmail.com>
Added completions for all long options specified in the docs
	--local --no-hardlinks --shared --reference
	--quiet --no-checkout --bare --mirror --origin
	--upload-pack --template= --depth
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
---
 contrib/completion/git-completion.bash |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 678a155..6ffe259 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -667,6 +667,31 @@ _git_cherry_pick ()
 	esac
 }
 
+_git_clone ()
+{
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--local
+			--no-hardlinks
+			--shared
+			--reference
+			--quiet
+			--no-checkout
+			--bare
+			--mirror
+			--origin
+			--upload-pack
+			--template=
+			--depth
+			"
+		return
+		;;
+	esac
+	COMPREPLY=()
+}
+
 _git_commit ()
 {
 	__git_has_doubledash && return
@@ -1475,6 +1500,7 @@ _git ()
 	checkout)    _git_checkout ;;
 	cherry)      _git_cherry ;;
 	cherry-pick) _git_cherry_pick ;;
+	clone)       _git_clone ;;
 	commit)      _git_commit ;;
 	config)      _git_config ;;
 	describe)    _git_describe ;;
-- 
1.6.0.rc1.48.g2b6032
Previous: Lee MarlowNext: Lee Marlow
Message 2 of 13 in “bash completion: more porcelain completions”
  1. 0/8 bash completion: more porcelain completionsLee Marlow, Aug 5, 2008
  2. 1/8 bash completion: Add completion for 'git clone'Lee Marlow, Aug 5, 2008
  3. 2/8 bash completion: Add completion for 'git clean'Lee Marlow, Aug 5, 2008
  4. 3/8 bash completion: Add completion for 'git init'Lee Marlow, Aug 5, 2008
  5. 4/8 bash completion: Add completion for 'git revert'Lee Marlow, Aug 5, 2008
  6. 5/8 bash completion: More completions for 'git stash'Lee Marlow, Aug 5, 2008
  7. 6/8 bash completion: Add completion for 'git archive'Lee Marlow, Aug 5, 2008
  8. 7/8 bash completion: Add completion for 'git ls-files'Lee Marlow, Aug 5, 2008
  9. bash: remove redundant check for 'git stash apply' optionsSZEDER Gábor, Aug 6, 2008
  10. Shawn O. PearceAug 6, 2008
  11. Shawn O. PearceAug 5, 2008
  12. Junio C HamanoAug 5, 2008
  13. Shawn O. PearceAug 5, 2008

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.