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

[PATCH 1/3] Add --format that is a synonym to --pretty

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Feb 24, 2009, 09:59 UTC
Message-ID
<20090224185914.6117@nanako3.lavabit.com>
In-Reply-To
<20090224185913.6117@nanako3.lavabit.com>

Some people prefer to call the pretty-print styles "format", and get annoyed to see "git log --format=short" fail. Introduce it as a synonym to --pretty so that both can be used.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
 Documentation/pretty-options.txt |    1 +
 revision.c                       |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index 5f21efe..6596019 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -1,4 +1,5 @@
 --pretty[='<format>']::
+--format[='<format>']::
 
 	Pretty-print the contents of the commit logs in a given format,
 	where '<format>' can be one of 'oneline', 'short', 'medium',
diff --git a/revision.c b/revision.c
index 286e416..556c319 100644
--- a/revision.c
+++ b/revision.c
@@ -1144,7 +1144,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 	} else if (!strcmp(arg, "--pretty")) {
 		revs->verbose_header = 1;
 		get_commit_format(arg+8, revs);
-	} else if (!prefixcmp(arg, "--pretty=")) {
+	} else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
 		revs->verbose_header = 1;
 		get_commit_format(arg+9, revs);
 	} else if (!strcmp(arg, "--graph")) {
-- 
1.6.2.rc1


-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Nanako ShiraishiNext: Nanako Shiraishi
Message 2 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.