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

[PATCH 1/2] git-completion.bash: __git_diff_common_options: add --[no-]patch

From
RKRobert Karszniewicz <avoidr@posteo.de>
Date
Oct 6, 2020, 22:06 UTC
Message-ID
<20201006220637.28139-1-avoidr@posteo.de>

At the same time also deduplicate those options from command completions which use $__git_diff_common_options.

Signed-off-by: Robert Karszniewicz <avoidr@posteo.de>
---
 contrib/completion/git-completion.bash | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0a96ad87e7..f363554996 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1688,6 +1688,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
 			--submodule --submodule= --ignore-submodules
 			--indent-heuristic --no-indent-heuristic
 			--textconv --no-textconv
+			--patch --no-patch
 "
 
 _git_diff ()
@@ -2031,11 +2032,9 @@ _git_log ()
 			--no-walk --no-walk= --do-walk
 			--parents --children
 			--expand-tabs --expand-tabs= --no-expand-tabs
-			--patch
 			$merge
 			$__git_diff_common_options
 			--pickaxe-all --pickaxe-regex
-			--patch --no-patch
 			"
 		return
 		;;
@@ -2938,7 +2937,7 @@ _git_show ()
 		;;
 	--*)
 		__gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit
-			--oneline --show-signature --patch
+			--oneline --show-signature
 			--expand-tabs --expand-tabs= --no-expand-tabs
 			$__git_diff_common_options
 			"
-- 
2.28.0
Next: Robert Karszniewicz
Message 1 of 3 in “git-completion.bash: __git_diff_common_options: add --[no-]patch”
  1. 1/2 git-completion.bash: __git_diff_common_options: add --[no-]patchRobert Karszniewicz, Oct 6, 2020
  2. 2/2 git-completion.bash: stash-show: complete $__git_diff_common_optionsRobert Karszniewicz, Oct 6, 2020
  3. Junio C HamanoOct 7, 2020

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.