@matheusbsbs / matheus-bagliano / commits / de84accc59
Fork 0

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>

Nanako Shiraishi committed Feb 24, 2009 at 18:59 UTC de84accc59baef73f7827d59f0d479521ecad937
2 files changed +8
Documentation/pretty-options.txt
+4
@@ -18,6 +18,10 @@ configuration (see linkgit:git-config[1]).
18 This should make "--pretty=oneline" a whole lot more readable for
19 people using 80-column terminals.
20
21 +--oneline::
22 + This is a shorthand for "--pretty=oneline --abbrev-commit"
23 + used together.
24 +
25 --encoding[=<encoding>]::
26 The commit objects record the encoding used for the log message
27 in their encoding header; this option can be used to tell the
revision.c
+4
@@ -1147,6 +1147,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
1147 } else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
1148 revs->verbose_header = 1;
1149 get_commit_format(arg+9, revs);
1150 + } else if (!strcmp(arg, "--oneline")) {
1151 + revs->verbose_header = 1;
1152 + get_commit_format("oneline", revs);
1153 + revs->abbrev_commit = 1;
1154 } else if (!strcmp(arg, "--graph")) {
1155 revs->topo_order = 1;
1156 revs->rewrite_parents = 1;