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>
This commit is contained in:
committed by
Junio C Hamano
parent
24852d9171
commit
1df2d656cc
6
pretty.c
6
pretty.c
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user