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

[PATCH v2 2/7] completion: add subcommand completion for rerere

From
Ccornelius.weig@tngtech.com <cornelius.weig@tngtech.com>
Date
Feb 3, 2017, 11:01 UTC
Message-ID
<20170203110159.377-3-cornelius.weig@tngtech.com>
In-Reply-To
<20170203110159.377-1-cornelius.weig@tngtech.com>
From: Cornelius Weig <cornelius.weig@tngtech.com>

Managing recorded resolutions requires command-line usage of git-rerere. Added subcommand completion for rerere and path completion for its subcommand forget.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 contrib/completion/git-completion.bash | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c54a557..8329f09 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2401,6 +2401,17 @@ _git_replace ()
 	__gitcomp_nl "$(__git_refs)"
 }
 
+_git_rerere ()
+{
+	local subcommands="clear forget diff remaining status gc"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+	if test -z "$subcommand"
+	then
+		__gitcomp "$subcommands"
+		return
+	fi
+}
+
 _git_reset ()
 {
 	__git_has_doubledash && return
-- 
2.10.2
Previous: cornelius.weig@tngtech.comNext: Junio C Hamano
Message 8 of 10 in “completion bash: add more options and commands”
  1. 0/7 completion bash: add more options and commandscornelius.weig@tngtech.com, Feb 3, 2017
  2. 3/7 completion: improve bash completion for git-addcornelius.weig@tngtech.com, Feb 3, 2017
  3. 4/7 completion: teach ls-remote to complete optionscornelius.weig@tngtech.com, Feb 3, 2017
  4. 7/7 completion: recognize more long-optionscornelius.weig@tngtech.com, Feb 3, 2017
  5. 5/7 completion: teach replace to complete optionscornelius.weig@tngtech.com, Feb 3, 2017
  6. 6/7 completion: teach remote subcommands to complete optionscornelius.weig@tngtech.com, Feb 3, 2017
  7. 1/7 completion: teach submodule subcommands to complete optionscornelius.weig@tngtech.com, Feb 3, 2017
  8. 2/7 completion: add subcommand completion for rererecornelius.weig@tngtech.com, Feb 3, 2017
  9. Junio C HamanoFeb 6, 2017
  10. Johannes SixtFeb 7, 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.