diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2006-05-05 04:30:52 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-05 14:11:57 -0700 |
commit | 596524b33d50e47e2375cec9e00aff59f0e8278b (patch) | |
tree | e215eb4bddd8aea4b91661d0580eeaffa873abee /log-tree.c | |
parent | 2448482b3d5e265dd29fa38c3827565f6f2f31ec (diff) | |
download | git-596524b33d50e47e2375cec9e00aff59f0e8278b.tar.gz |
Teach fmt-patch about --numbered
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/log-tree.c b/log-tree.c index aaf2b9423f..1ca529d9fe 100644 --- a/log-tree.c +++ b/log-tree.c @@ -11,6 +11,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) { @@ -38,10 +39,18 @@ 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 + subject = "Subject: [PATCH] "; 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)); @@ -55,7 +64,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); } |