diff options
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/log-tree.c b/log-tree.c index 08970bf46e..95e9b1da25 100644 --- a/log-tree.c +++ b/log-tree.c @@ -100,7 +100,7 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in if (starts_with(refname, "refs/replace/")) { unsigned char original_sha1[20]; - if (!read_replace_refs) + if (!check_replace_refs) return 0; if (get_sha1_hex(refname + 13, original_sha1)) { warning("invalid replace ref %s", refname); @@ -365,6 +365,7 @@ static void show_sig_lines(struct rev_info *opt, int status, const char *bol) eol = strchrnul(bol, '\n'); printf("%s%.*s%s%s", color, (int)(eol - bol), bol, reset, *eol ? "\n" : ""); + graph_show_oneline(opt->graph); bol = (*eol) ? (eol + 1) : eol; } } @@ -376,7 +377,7 @@ static void show_signature(struct rev_info *opt, struct commit *commit) struct strbuf gpg_output = STRBUF_INIT; int status; - if (parse_signed_commit(commit->object.sha1, &payload, &signature) <= 0) + if (parse_signed_commit(commit, &payload, &signature) <= 0) goto out; status = verify_signed_buffer(payload.buf, payload.len, @@ -413,10 +414,11 @@ static int is_common_merge(const struct commit *commit) && !commit->parents->next->next); } -static void show_one_mergetag(struct rev_info *opt, +static void show_one_mergetag(struct commit *commit, struct commit_extra_header *extra, - struct commit *commit) + void *data) { + struct rev_info *opt = (struct rev_info *)data; unsigned char sha1[20]; struct tag *tag; struct strbuf verify_message; @@ -446,16 +448,17 @@ static void show_one_mergetag(struct rev_info *opt, payload_size = parse_signature(extra->value, extra->len); status = -1; - if (extra->len > payload_size) - if (verify_signed_buffer(extra->value, payload_size, - extra->value + payload_size, - extra->len - payload_size, - &verify_message, NULL)) { - if (verify_message.len <= gpg_message_offset) - strbuf_addstr(&verify_message, "No signature\n"); - else - status = 0; - } + if (extra->len > payload_size) { + /* could have a good signature */ + if (!verify_signed_buffer(extra->value, payload_size, + extra->value + payload_size, + extra->len - payload_size, + &verify_message, NULL)) + status = 0; /* good */ + else if (verify_message.len <= gpg_message_offset) + strbuf_addstr(&verify_message, "No signature\n"); + /* otherwise we couldn't verify, which is shown as bad */ + } show_sig_lines(opt, status, verify_message.buf); strbuf_release(&verify_message); @@ -463,15 +466,7 @@ static void show_one_mergetag(struct rev_info *opt, static void show_mergetag(struct rev_info *opt, struct commit *commit) { - struct commit_extra_header *extra, *to_free; - - to_free = read_commit_extra_headers(commit, NULL); - for (extra = to_free; extra; extra = extra->next) { - if (strcmp(extra->key, "mergetag")) - continue; /* not a merge tag */ - show_one_mergetag(opt, extra, commit); - } - free_commit_extra_headers(to_free); + for_each_mergetag(show_one_mergetag, commit, opt); } void show_log(struct rev_info *opt) @@ -588,7 +583,7 @@ void show_log(struct rev_info *opt) show_mergetag(opt, commit); } - if (!commit->buffer) + if (!get_cached_commit_buffer(commit, NULL)) return; if (opt->show_notes) { @@ -654,7 +649,7 @@ void show_log(struct rev_info *opt) graph_show_commit_msg(opt->graph, &msgbuf); else fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout); - if (opt->use_terminator) { + if (opt->use_terminator && !commit_format_is_empty(opt->commit_format)) { if (!opt->missing_newline) graph_show_padding(opt->graph); putchar(opt->diffopt.line_termination); @@ -681,7 +676,8 @@ int log_tree_diff_flush(struct rev_info *opt) show_log(opt); if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) && opt->verbose_header && - opt->commit_format != CMIT_FMT_ONELINE) { + opt->commit_format != CMIT_FMT_ONELINE && + !commit_format_is_empty(opt->commit_format)) { /* * When showing a verbose header (i.e. log message), * and not in --pretty=oneline format, we would want @@ -805,12 +801,16 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit) if (opt->line_level_traverse) return line_log_print(opt, commit); + if (opt->track_linear && !opt->linear && !opt->reverse_output_stage) + printf("\n%s\n", opt->break_bar); shown = log_tree_diff(opt, commit, &log); if (!shown && opt->loginfo && opt->always_show_header) { log.parent = NULL; show_log(opt); shown = 1; } + if (opt->track_linear && !opt->linear && opt->reverse_output_stage) + printf("\n%s\n", opt->break_bar); opt->loginfo = NULL; maybe_flush_or_die(stdout, "stdout"); return shown; |