aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanako Shiraishi <nanako3@lavabit.com>2009-02-24 18:59:16 +0900
committerJunio C Hamano <gitster@pobox.com>2009-02-24 23:53:40 -0800
commitde84accc59baef73f7827d59f0d479521ecad937 (patch)
treedb6f3a500d73a939106a4ec40471ff83e1995dfc
parent36407548a2825462a91b456755412a65fd611fc0 (diff)
downloadgit-de84accc59baef73f7827d59f0d479521ecad937.tar.gz
git-de84accc59baef73f7827d59f0d479521ecad937.tar.xz
Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit"
These two are often used together but are too long to type. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/pretty-options.txt4
-rw-r--r--revision.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index 65960192e..bff94991b 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -18,6 +18,10 @@ configuration (see linkgit:git-config[1]).
This should make "--pretty=oneline" a whole lot more readable for
people using 80-column terminals.
+--oneline::
+ This is a shorthand for "--pretty=oneline --abbrev-commit"
+ used together.
+
--encoding[=<encoding>]::
The commit objects record the encoding used for the log message
in their encoding header; this option can be used to tell the
diff --git a/revision.c b/revision.c
index 556c3195b..c4efe5b22 100644
--- a/revision.c
+++ b/revision.c
@@ -1147,6 +1147,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
revs->verbose_header = 1;
get_commit_format(arg+9, revs);
+ } else if (!strcmp(arg, "--oneline")) {
+ revs->verbose_header = 1;
+ get_commit_format("oneline", revs);
+ revs->abbrev_commit = 1;
} else if (!strcmp(arg, "--graph")) {
revs->topo_order = 1;
revs->rewrite_parents = 1;