X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=log-tree.c;h=526d578e98eef5a099be43bf39a300b33ac1991c;hb=8a24f2fae0a08d5832318b62cb279fd02f1bdf5a;hp=d92abaf64bc3cecce06f09d1e523c8f203a93b06;hpb=4cc0b8a41b25356ad89f13ec2735756e5dada02a;p=git.git diff --git a/log-tree.c b/log-tree.c index d92abaf64..526d578e9 100644 --- a/log-tree.c +++ b/log-tree.c @@ -20,6 +20,7 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) int abbrev_commit = opt->abbrev_commit ? opt->abbrev : 40; const char *extra; int len; + char* subject = NULL; opt->loginfo = NULL; if (!opt->verbose_header) { @@ -50,10 +51,21 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) * Print header line of header.. */ - if (opt->commit_format == CMIT_FMT_EMAIL) + if (opt->commit_format == CMIT_FMT_EMAIL) { + if (opt->total > 0) { + static char buffer[64]; + snprintf(buffer, sizeof(buffer), + "Subject: [PATCH %d/%d] ", + opt->nr, opt->total); + subject = buffer; + } else if (opt->total == 0) + subject = "Subject: [PATCH] "; + else + subject = "Subject: "; + printf("From %s Thu Apr 7 15:13:13 2005\n", sha1_to_hex(commit->object.sha1)); - else { + } else { printf("%s%s", opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ", diff_unique_abbrev(commit->object.sha1, abbrev_commit)); @@ -69,7 +81,7 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) /* * And then the pretty-printed message itself */ - len = pretty_print_commit(opt->commit_format, commit, ~0u, this_header, sizeof(this_header), abbrev); + len = pretty_print_commit(opt->commit_format, commit, ~0u, this_header, sizeof(this_header), abbrev, subject); printf("%s%s%s", this_header, extra, sep); }