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

[PATCH] bash completion: add --format= and --oneline options for "git log"

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Feb 24, 2009, 11:02 UTC
Message-ID
<871vtonlmv.fsf_-_@iki.fi>
In-Reply-To
<20090224185913.6117@nanako3.lavabit.com>
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---

I like this change and would immediately switch to using --format= and --oneline instead of --pretty=. I think we should add these bash completions too.

 contrib/completion/git-completion.bash |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0a3092f..34396c2 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1012,10 +1012,15 @@ _git_log ()
 	--pretty=*)
 		__gitcomp "$__git_log_pretty_formats
 			" "" "${cur##--pretty=}"
 		return
 		;;
+	--format=*)
+		__gitcomp "$__git_log_pretty_formats
+			" "" "${cur##--format=}"
+		return
+		;;
 	--date=*)
 		__gitcomp "
 			relative iso8601 rfc2822 short local default
 		" "" "${cur##--date=}"
 		return
@@ -1028,10 +1033,12 @@ _git_log ()
 			--root --topo-order --date-order --reverse
 			--follow
 			--abbrev-commit --abbrev=
 			--relative-date --date=
 			--pretty=
+			--format=
+			--oneline
 			--cherry-pick
 			--graph
 			--decorate
 			--walk-reflogs
 			--parents --children
-- 
1.6.2.rc1.29.g79ccf
Previous: Jeff KingNext: Teemu Likonen
Message 11 of 17 in “--format, --pretty and --oneline”
  1. 0/3 --format, --pretty and --onelineNanako Shiraishi, Feb 24, 2009
  2. 1/3 Add --format that is a synonym to --prettyNanako Shiraishi, Feb 24, 2009
  3. 2/3 Give short-hands to --pretty=tformat:%formatstringNanako Shiraishi, Feb 24, 2009
  4. 3/3 Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit"Nanako Shiraishi, Feb 24, 2009
  5. Junio C HamanoFeb 24, 2009
  6. Add tests for git log --pretty, --format and --oneline.Felipe Contreras, Feb 24, 2009
  7. Junio C HamanoFeb 25, 2009
  8. Jeff KingFeb 25, 2009
  9. Junio C HamanoFeb 25, 2009
  10. Jeff KingFeb 25, 2009
  11. bash completion: add --format= and --oneline options for "git log"Teemu Likonen, Feb 24, 2009
  12. bash completion: add --format= and --oneline options for "git log"Teemu Likonen, Feb 24, 2009
  13. Shawn O. PearceFeb 24, 2009
  14. Teemu LikonenFeb 24, 2009
  15. Shawn O. PearceFeb 24, 2009
  16. Teemu LikonenFeb 24, 2009
  17. Teemu LikonenFeb 27, 2009

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.