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

[PATCH 2/2] bash: support pretty format aliases

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Oct 14, 2010, 08:58 UTC
Message-ID
<1287046727-22509-2-git-send-email-szeder@ira.uka.de>
In-Reply-To
<20101014085538.GB838@neumann>

Users can have their own pretty format aliases since 8028184 (pretty: add aliases for pretty formats, 2010-05-02), so let's offer those after '--pretty=' and '--format=' for 'log' and 'show', too.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 97a3d8c..a4b6f78 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1368,11 +1368,13 @@ _git_log ()
 	case "$cur" in
 	--pretty=*)
 		__gitcomp "$__git_log_pretty_formats
+			$(__git_get_config_variables "pretty")
 			" "" "${cur##--pretty=}"
 		return
 		;;
 	--format=*)
 		__gitcomp "$__git_log_pretty_formats
+			$(__git_get_config_variables "pretty")
 			" "" "${cur##--format=}"
 		return
 		;;
@@ -2095,11 +2097,13 @@ _git_show ()
 	case "$cur" in
 	--pretty=*)
 		__gitcomp "$__git_log_pretty_formats
+			$(__git_get_config_variables "pretty")
 			" "" "${cur##--pretty=}"
 		return
 		;;
 	--format=*)
 		__gitcomp "$__git_log_pretty_formats
+			$(__git_get_config_variables "pretty")
 			" "" "${cur##--format=}"
 		return
 		;;
-- 
1.7.3.1.151.g3779c
Previous: SZEDER Gábor
Message 8 of 8 in “bash: support pretty format aliases”
  1. bash: support pretty format aliasesSZEDER Gábor, Oct 10, 2010
  2. Jonathan NiederOct 10, 2010
  3. bash: support pretty format aliasesSZEDER Gábor, Oct 10, 2010
  4. SZEDER GáborOct 14, 2010
  5. 1/2 bash: add helper function to get config variables for completionSZEDER Gábor, Oct 14, 2010
  6. Jonathan NiederOct 14, 2010
  7. SZEDER GáborOct 20, 2010
  8. 2/2 bash: support pretty format aliasesSZEDER Gábor, Oct 14, 2010

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.