Skip to content

Commit

Permalink
Add --format that is a synonym to --pretty
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nanako Shiraishi authored and Junio C Hamano committed Feb 25, 2009
1 parent d43c07b commit 3a4c1a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/pretty-options.txt
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
2 changes: 1 addition & 1 deletion revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit 3a4c1a5

Please sign in to comment.