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

[PATCH 1/6] bash: Support completion on git-cherry.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 5, 2007, 20:44 UTC
Message-ID
<20070205204422.GA8824@spearce.org>

I just realized I did not support ref name completion for git-cherry. This tool is just too useful to contributors who submit patches upstream by email; completion support for it is very handy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 contrib/completion/git-completion.bash |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 2387506..c22ff48 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -415,6 +415,11 @@ _git_checkout ()
 	__gitcomp "$(__git_refs)"
 }
 
+_git_cherry ()
+{
+	__gitcomp "$(__git_refs)"
+}
+
 _git_cherry_pick ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -893,6 +898,7 @@ _git ()
 	apply)       _git_apply ;;
 	branch)      _git_branch ;;
 	checkout)    _git_checkout ;;
+	cherry)      _git_cherry ;;
 	cherry-pick) _git_cherry_pick ;;
 	commit)      _git_commit ;;
 	config)      _git_config ;;
@@ -936,6 +942,7 @@ complete -o default -o nospace -F _git_am git-am
 complete -o default -o nospace -F _git_apply git-apply
 complete -o default -o nospace -F _git_branch git-branch
 complete -o default -o nospace -F _git_checkout git-checkout
+complete -o default -o nospace -F _git_cherry git-cherry
 complete -o default -o nospace -F _git_cherry_pick git-cherry-pick
 complete -o default -o nospace -F _git_commit git-commit
 complete -o default -o nospace -F _git_diff git-diff
@@ -967,6 +974,7 @@ complete -o default -o nospace -F _git_add git-add.exe
 complete -o default -o nospace -F _git_apply git-apply.exe
 complete -o default -o nospace -F _git git.exe
 complete -o default -o nospace -F _git_branch git-branch.exe
+complete -o default -o nospace -F _git_cherry git-cherry.exe
 complete -o default -o nospace -F _git_diff git-diff.exe
 complete -o default -o nospace -F _git_diff_tree git-diff-tree.exe
 complete -o default -o nospace -F _git_format_patch git-format-patch.exe
-- 
1.5.0.rc3.58.g79812
Message 1 of 1 in “bash: Support completion on git-cherry.”
  1. 1/6 bash: Support completion on git-cherry.Shawn O. Pearce, Feb 5, 2007

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.