diff options
author | Michael J Gruber <git@drmicha.warpmail.net> | 2011-03-07 13:31:39 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-09 13:50:54 -0800 |
commit | 1df2d656cc442dc057e30b6fb130967e5ae19654 (patch) | |
tree | 6290981baed52c65c997e7e0eb172651d9af26ff /pretty.c | |
parent | rev-list: --left/right-only are mutually exclusive (diff) | |
download | tgif-1df2d656cc442dc057e30b6fb130967e5ae19654.tar.xz |
rev-list/log: factor out revision mark generation
Currently, we have identical code for generating revision marks ('<',
'>', '-') in 5 places.
Factor out the code to a single function get_revision_mark() for easier
maintenance and extensibility.
Note that the check for !!revs in graph.c (which gets removed
effectively by this patch) is superfluous.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -859,11 +859,7 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder, c->abbrev_parent_hashes.off; return 1; case 'm': /* left/right/bottom */ - strbuf_addch(sb, (commit->object.flags & BOUNDARY) - ? '-' - : (commit->object.flags & SYMMETRIC_LEFT) - ? '<' - : '>'); + strbuf_addstr(sb, get_revision_mark(NULL, commit)); return 1; case 'd': format_decoration(sb, commit); |