summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-06-27 22:08:19 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-27 22:33:40 (GMT)
commit3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 (patch)
tree2b16523d7552997a7c3f562a4f2bffbc207a926c /log-tree.c
parenta959e0dc16907c4dc123cfac7bd22c636064a638 (diff)
downloadgit-3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.zip
git-3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.tar.gz
git-3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.tar.bz2
Fix some more diff options changes.
This fixes various problems in the new diff options code. - Fix --cc/-c --patch; it showed two-tree diff used internally. - Use "---\n" only where it matters -- that is, use it immediately after the commit log text when we show a commit log and something else before the patch text. - Do not output spurious extra "\n"; have an extra newline after the commit log text always when we have diff output and we are not doing oneline. - When running a pickaxe you need to go recursive. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/log-tree.c b/log-tree.c
index ab6b682..9d8d46f 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -164,9 +164,22 @@ int log_tree_diff_flush(struct rev_info *opt)
return 0;
}
- if (opt->loginfo && !opt->no_commit_id)
+ if (opt->loginfo && !opt->no_commit_id) {
+ /* When showing a verbose header (i.e. log message),
+ * and not in --pretty=oneline format, we would want
+ * an extra newline between the end of log and the
+ * output for readability.
+ */
show_log(opt, opt->diffopt.msg_sep);
-
+ if (opt->verbose_header &&
+ opt->commit_format != CMIT_FMT_ONELINE) {
+ int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
+ if ((pch & opt->diffopt.output_format) == pch)
+ printf("---%c", opt->diffopt.line_termination);
+ else
+ putchar(opt->diffopt.line_termination);
+ }
+ }
diff_flush(&opt->diffopt);
return 1;
}