Fix revision log diff setup, avoid unnecessary diff generation
[gitweb.git] / log-tree.c
index 0cf21bc05180b577a5f14dc57031c260e7c44334..a6423718e76be34e62bc76dcf3c93b32e38aa152 100644 (file)
@@ -200,7 +200,7 @@ void show_log(struct rev_info *opt, const char *sep)
                                        digits_in_number(opt->total),
                                        opt->nr, opt->total);
                        subject = buffer;
-               } else if (opt->total == 0) {
+               } else if (opt->total == 0 && opt->subject_prefix && *opt->subject_prefix) {
                        static char buffer[256];
                        snprintf(buffer, sizeof(buffer),
                                        "Subject: [%s] ",
@@ -295,6 +295,9 @@ void show_log(struct rev_info *opt, const char *sep)
        if (opt->add_signoff)
                len = append_signoff(&msgbuf, &msgbuf_len, len,
                                     opt->add_signoff);
+       if (opt->show_log_size)
+               printf("log size %i\n", len);
+
        printf("%s%s%s", msgbuf, extra, sep);
        free(msgbuf);
 }
@@ -408,5 +411,6 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit)
                shown = 1;
        }
        opt->loginfo = NULL;
+       maybe_flush_or_die(stdout, "stdout");
        return shown;
 }