aboutsummaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-03-07 13:31:39 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-09 13:50:54 -0800
commit1df2d656cc442dc057e30b6fb130967e5ae19654 (patch)
tree6290981baed52c65c997e7e0eb172651d9af26ff /log-tree.c
parent24852d917104e294726c54803d5c9012997506ca (diff)
downloadgit-1df2d656cc442dc057e30b6fb130967e5ae19654.tar.gz
git-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 'log-tree.c')
-rw-r--r--log-tree.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/log-tree.c b/log-tree.c
index b46ed3bae..125704031 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -380,18 +380,8 @@ void show_log(struct rev_info *opt)
if (!opt->verbose_header) {
graph_show_commit(opt->graph);
- if (!opt->graph) {
- if (commit->object.flags & BOUNDARY)
- putchar('-');
- else if (commit->object.flags & UNINTERESTING)
- putchar('^');
- else if (opt->left_right) {
- if (commit->object.flags & SYMMETRIC_LEFT)
- putchar('<');
- else
- putchar('>');
- }
- }
+ if (!opt->graph)
+ fputs(get_revision_mark(opt, commit), stdout);
fputs(find_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
if (opt->print_parents)
show_parents(commit, abbrev_commit);
@@ -448,18 +438,8 @@ void show_log(struct rev_info *opt)
if (opt->commit_format != CMIT_FMT_ONELINE)
fputs("commit ", stdout);
- if (!opt->graph) {
- if (commit->object.flags & BOUNDARY)
- putchar('-');
- else if (commit->object.flags & UNINTERESTING)
- putchar('^');
- else if (opt->left_right) {
- if (commit->object.flags & SYMMETRIC_LEFT)
- putchar('<');
- else
- putchar('>');
- }
- }
+ if (!opt->graph)
+ fputs(get_revision_mark(opt, commit), stdout);
fputs(find_unique_abbrev(commit->object.sha1, abbrev_commit),
stdout);
if (opt->print_parents)